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

fix(view): isLoaded handling · NativeScript/NativeScript@cbd5952 · GitHub

Commit cbd5952

Browse files
committed
fix(view): isLoaded handling
closes #6179
1 parent 8e9c6d5 commit cbd5952

4 files changed

Lines changed: 6 additions & 6 deletions

File tree

‎tns-core-modules/ui/core/view-base/view-base.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -595,13 +595,13 @@ export abstract class ViewBase extends Observable implements ViewBaseDefinition
595595
}
596596

597597
public loadView(view: ViewBase): void {
598-
if (!view.isLoaded) {
598+
if (view && !view.isLoaded) {
599599
view.callLoaded();
600600
}
601601
}
602602

603603
public unloadView(view: ViewBase): void {
604-
if (view.isLoaded) {
604+
if (view && view.isLoaded) {
605605
view.callUnloaded();
606606
}
607607
}

‎tns-core-modules/ui/core/view/view.android.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ function initializeDialogFragment() {
178178
}
179179

180180
const owner = this.owner;
181-
if (!owner.isLoaded) {
181+
if (owner && !owner.isLoaded) {
182182
owner.callLoaded();
183183
}
184184

@@ -194,7 +194,7 @@ function initializeDialogFragment() {
194194
}
195195

196196
const owner = this.owner;
197-
if (owner.isLoaded) {
197+
if (owner && owner.isLoaded) {
198198
owner.callUnloaded();
199199
}
200200
}

‎tns-core-modules/ui/frame/frame.android.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,7 @@ class FragmentCallbacksImplementation implements AndroidFragmentCallbacks {
736736
this.frame._addView(page);
737737
}
738738

739-
if (frame.isLoaded && !page.isLoaded) {
739+
if ((frame && frame.isLoaded) && (page && !page.isLoaded)) {
740740
page.callLoaded();
741741
}
742742

‎tns-core-modules/ui/styling/style-scope.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ export class CssState {
357357
* As a result, at some point in time, the selectors matched have to be requerried from the style scope and applied to the view.
358358
*/
359359
public onChange(): void {
360-
if (this.view.isLoaded) {
360+
if (this.view && this.view.isLoaded) {
361361
this.unsubscribeFromDynamicUpdates();
362362
this.updateMatch();
363363
this.subscribeForDynamicUpdates();

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL