mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-18 13:51:27 +08:00
in fact this does not seem to be necessary anymore
This commit is contained in:
@ -259,7 +259,7 @@ export class FrameBase extends CustomLayoutView {
|
|||||||
public _updateBackstack(entry: BackstackEntry, navigationType: NavigationType): void {
|
public _updateBackstack(entry: BackstackEntry, navigationType: NavigationType): void {
|
||||||
const isBack = navigationType === NavigationType.back;
|
const isBack = navigationType === NavigationType.back;
|
||||||
const isReplace = navigationType === NavigationType.replace;
|
const isReplace = navigationType === NavigationType.replace;
|
||||||
this.raiseCurrentPageNavigatedEvents(isBack, isReplace, entry.entry.clearHistory);
|
this.raiseCurrentPageNavigatedEvents(isBack);
|
||||||
const current = this._currentEntry;
|
const current = this._currentEntry;
|
||||||
|
|
||||||
// Do nothing for Hot Module Replacement
|
// Do nothing for Hot Module Replacement
|
||||||
@ -293,14 +293,9 @@ export class FrameBase extends CustomLayoutView {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private raiseCurrentPageNavigatedEvents(isBack: boolean, isReplace: boolean, clearHistory: boolean) {
|
private raiseCurrentPageNavigatedEvents(isBack: boolean) {
|
||||||
const page = this.currentPage;
|
const page = this.currentPage;
|
||||||
if (page) {
|
if (page) {
|
||||||
if ((isBack || isReplace || clearHistory) && page.isLoaded) {
|
|
||||||
console.log('unloading current page');
|
|
||||||
// Forward navigation does not remove page from frame so we raise unloaded manually.
|
|
||||||
page.callUnloaded();
|
|
||||||
}
|
|
||||||
page.onNavigatedFrom(isBack);
|
page.onNavigatedFrom(isBack);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user