MCPcopy Index your code
hub / github.com/NativeScript/NativeScript / goBack

Method goBack

packages/core/ui/frame/frame-common.ts:71–101  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

69 }
70
71 static goBack(): boolean {
72 const top = FrameBase.topmost();
73 if (top && top.canGoBack()) {
74 top.goBack();
75
76 return true;
77 } else if (top) {
78 let parentFrameCanGoBack = false;
79 let parentFrame = getAncestor(top, 'Frame');
80
81 while (parentFrame && !parentFrameCanGoBack) {
82 if (parentFrame && parentFrame.canGoBack()) {
83 parentFrameCanGoBack = true;
84 } else {
85 parentFrame = getAncestor(parentFrame, 'Frame');
86 }
87 }
88
89 if (parentFrame && parentFrameCanGoBack) {
90 parentFrame.goBack();
91
92 return true;
93 }
94 }
95
96 if (frameStack.length > 1) {
97 top._popFromFrameStack();
98 }
99
100 return false;
101 }
102
103 /**
104 * @private

Callers 4

goBackFunction · 0.45
onBackPressedMethod · 0.45
handleOnBackPressedFunction · 0.45
onBackPressedMethod · 0.45

Calls 9

canGoBackMethod · 0.95
getAncestorFunction · 0.90
isEnabledMethod · 0.80
indexOfMethod · 0.80
writeMethod · 0.65
topmostMethod · 0.45
_popFromFrameStackMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected