FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix(animation): handle promise rejection and avoid throw · NativeScript/NativeScript@d80bb16 · GitHub

Commit d80bb16

Browse files
committed
fix(animation): handle promise rejection and avoid throw
1 parent 7851629 commit d80bb16

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎tns-core-modules/ui/animation/keyframe-animation.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,10 +239,10 @@ export class KeyframeAnimation implements KeyframeAnimationDefinition {
239239
// Catch the animation cancel to prevent unhandled promise rejection warnings
240240
animation.play().then(() => {
241241
this.animate(view, index + 1, iterations);
242+
}, (error: any) => {
243+
traceWrite(typeof error === 'string' ? error : error.message, traceCategories.Animation, traceType.warn);
242244
}).catch((error: any) => {
243-
if (error.message.indexOf("Animation cancelled") < 0) {
244-
throw error;
245-
}
245+
traceWrite(typeof error === 'string' ? error : error.message, traceCategories.Animation, traceType.warn);
246246
}); // tslint:disable-line
247247
this._nativeAnimations.push(animation);
248248
}

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL