@@ -23,6 +23,7 @@ export const DELAY_BEFORE_ANIMATION = 300;
23
23
* @property {ButtonAnimationStyle } animationStyle
24
24
* @property {boolean } shouldTap
25
25
* @property {boolean } shouldWatchForRemoval
26
+ * @property {boolean } animateOnce
26
27
*/
27
28
28
29
/**
@@ -50,6 +51,9 @@ export default class AutofillPasswordImport extends ContentFeature {
50
51
51
52
#domLoaded;
52
53
54
+ /** @type {Set<string> } */
55
+ #animatedPaths = new Set ( ) ;
56
+
53
57
/**
54
58
* @returns {ButtonAnimationStyle }
55
59
*/
@@ -140,6 +144,7 @@ export default class AutofillPasswordImport extends ContentFeature {
140
144
element,
141
145
shouldTap : this . #settingsButtonSettings?. shouldAutotap ?? false ,
142
146
shouldWatchForRemoval : false ,
147
+ animateOnce : false ,
143
148
}
144
149
: null ;
145
150
} else if ( path === '/options' ) {
@@ -150,6 +155,7 @@ export default class AutofillPasswordImport extends ContentFeature {
150
155
element,
151
156
shouldTap : this . #exportButtonSettings?. shouldAutotap ?? false ,
152
157
shouldWatchForRemoval : true ,
158
+ animateOnce : true ,
153
159
}
154
160
: null ;
155
161
} else if ( path === '/intro' ) {
@@ -160,6 +166,7 @@ export default class AutofillPasswordImport extends ContentFeature {
160
166
element,
161
167
shouldTap : this . #signInButtonSettings?. shouldAutotap ?? false ,
162
168
shouldWatchForRemoval : false ,
169
+ animateOnce : false ,
163
170
}
164
171
: null ;
165
172
} else {
@@ -398,7 +405,10 @@ export default class AutofillPasswordImport extends ContentFeature {
398
405
if ( this . isSupportedPath ( path ) ) {
399
406
try {
400
407
this . setCurrentElementConfig ( await this . getElementAndStyleFromPath ( path ) ) ;
401
- await this . animateOrTapElement ( ) ;
408
+ if ( this . currentElementConfig ?. animateOnce && ! this . #animatedPaths. has ( path ) ) {
409
+ this . #animatedPaths. add ( path ) ;
410
+ await this . animateOrTapElement ( ) ;
411
+ }
402
412
} catch {
403
413
console . error ( 'password-import: failed for path:' , path ) ;
404
414
}
0 commit comments