8000 fix(ios): fix white screen on start (#672) · brysem/nativescript-vue@d2899a1 · GitHub
[go: up one dir, main page]

Skip to content

Commit d2899a1

Browse files
authored
fix(ios): fix white screen on start (nativescript-vue#672)
It comes from using nextTick. nextTick was used to be able to read __isNavigatedTo from the mounted event. I removed the need for __isNavigatedTo thus removing the need for the nextTick.
1 parent 3032c09 commit d2899a1

File tree

3 files changed

+6
-13
lines changed

3 files changed

+6
-13
lines changed

platform/nativescript/plugins/navigator-plugin.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ export default {
8585
})
8686
})
8787
const page = navEntryInstance.$mount().$el.nativeView
88-
page.__isNavigatedTo = true
8988

9089
updateDevtools()
9190

platform/nativescript/runtime/components/frame.js

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -105,21 +105,13 @@ export default {
105105
return entry
106106
},
107107

108-
notifyPageMounted(pageVm) {
108+
notifyFirstPageMounted(pageVm) {
109109
let options = {
110110
backstackVisible: this.backstackVisible,
111111
clearHistory: this.clearHistory,
112112
create: () => pageVm.$el.nativeView
113113
}
114-
115-
this.$nextTick(() => {
116-
if (pageVm.$el.nativeView.__isNavigatedTo) {
117-
// Ignore pages we've navigated to, since they are already on screen
118-
return
119-
}
120-
121-
this.navigate(options)
122-
})
114+
this.navigate(options)
123115
},
124116

125117
navigate(entry, back = false) {

platform/nativescript/runtime/components/page.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@ export default {
1818

1919
let frame = this._findParentFrame()
2020

21-
if (frame) {
22-
frame.notifyPageMounted(this)
21+
// we only need call this for the "defaultPage" of the frame
22+
// which is equivalent to testing if any page is "current" in the frame
23+
if (frame && (!frame.$el.nativeView.currentPage )) {
24+
frame.notifyFirstPageMounted(this)
2325
}
2426

2527
const handler = e => {

0 commit comments

Comments
 (0)
0