mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 19:21:34 +08:00
fix(angular): swiping back quickly no longer causes app to get stuck (#23125)
resolves #15154
This commit is contained in:
@ -52,7 +52,7 @@ export class IonRouterOutlet implements OnDestroy, OnInit {
|
|||||||
this._swipeGesture = swipe;
|
this._swipeGesture = swipe;
|
||||||
|
|
||||||
this.nativeEl.swipeHandler = swipe ? {
|
this.nativeEl.swipeHandler = swipe ? {
|
||||||
canStart: () => this.stackCtrl.canGoBack(1),
|
canStart: () => this.stackCtrl.canGoBack(1) && !this.stackCtrl.hasRunningTask(),
|
||||||
onStart: () => this.stackCtrl.startBackTransition(),
|
onStart: () => this.stackCtrl.startBackTransition(),
|
||||||
onEnd: shouldContinue => this.stackCtrl.endBackTransition(shouldContinue)
|
onEnd: shouldContinue => this.stackCtrl.endBackTransition(shouldContinue)
|
||||||
} : undefined;
|
} : undefined;
|
||||||
|
@ -232,6 +232,10 @@ export class StackController {
|
|||||||
return this.activeView ? this.activeView.stackId : undefined;
|
return this.activeView ? this.activeView.stackId : undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hasRunningTask(): boolean {
|
||||||
|
return this.runningTask !== undefined;
|
||||||
|
}
|
||||||
|
|
||||||
destroy() {
|
destroy() {
|
||||||
this.containerEl = undefined!;
|
this.containerEl = undefined!;
|
||||||
this.views.forEach(destroyView);
|
this.views.forEach(destroyView);
|
||||||
@ -294,6 +298,7 @@ export class StackController {
|
|||||||
this.runningTask = undefined;
|
this.runningTask = undefined;
|
||||||
}
|
}
|
||||||
const promise = this.runningTask = task();
|
const promise = this.runningTask = task();
|
||||||
|
promise.finally(() => this.runningTask = undefined);
|
||||||
return promise;
|
return promise;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user