-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
fix(android): Better handling for nested frames #10713
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
d04010c
6681717
1edaae1
f8991e6
8052bd8
f557233
0d1b8d9
67eb657
af0bb62
132527f
720d4de
1fcf2fb
dcee835
e5cf840
a25fc5b
d43d852
a0a74b3
8f40627
360ba2d
417c6d6
2c64037
8a54695
211f28f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -76,13 +76,13 @@ export class FrameBase extends CustomLayoutView { | |||||||||||||||||||||||||||||||||||||||||
| return true; | ||||||||||||||||||||||||||||||||||||||||||
| } else if (top) { | ||||||||||||||||||||||||||||||||||||||||||
| let parentFrameCanGoBack = false; | ||||||||||||||||||||||||||||||||||||||||||
| let parentFrame = <FrameBase>getAncestor(top, 'Frame'); | ||||||||||||||||||||||||||||||||||||||||||
| let parentFrame = getAncestor(top, 'Frame'); | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| while (parentFrame && !parentFrameCanGoBack) { | ||||||||||||||||||||||||||||||||||||||||||
| if (parentFrame && parentFrame.canGoBack()) { | ||||||||||||||||||||||||||||||||||||||||||
| parentFrameCanGoBack = true; | ||||||||||||||||||||||||||||||||||||||||||
| } else { | ||||||||||||||||||||||||||||||||||||||||||
| parentFrame = <FrameBase>getAncestor(parentFrame, 'Frame'); | ||||||||||||||||||||||||||||||||||||||||||
| parentFrame = getAncestor(parentFrame, 'Frame'); | ||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+79
to
86
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Use
- let parentFrame = getAncestor(top, 'Frame');
+ let parentFrame: FrameBase | undefined = getAncestor(top, FrameBase);
…
- parentFrame = getAncestor(parentFrame, 'Frame');
+ parentFrame = getAncestor(parentFrame, FrameBase);Besides safer autocompletion, this change will surface misspelled members at compile-time instead of runtime. 📝 Committable suggestion
Suggested change
🧰 Tools🪛 Biome (1.9.4)[error] 82-82: Change to an optional chain. Unsafe fix: Change to an optional chain. (lint/complexity/useOptionalChain) 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -122,7 +122,6 @@ export class FrameBase extends CustomLayoutView { | |||||||||||||||||||||||||||||||||||||||||
| @profile | ||||||||||||||||||||||||||||||||||||||||||
| public onLoaded() { | ||||||||||||||||||||||||||||||||||||||||||
| super.onLoaded(); | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| this._processNextNavigationEntry(); | ||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -323,9 +322,10 @@ export class FrameBase extends CustomLayoutView { | |||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| private isNestedWithin(parentFrameCandidate: FrameBase): boolean { | ||||||||||||||||||||||||||||||||||||||||||
| let frameAncestor: FrameBase = this; | ||||||||||||||||||||||||||||||||||||||||||
| let frameAncestor = this as FrameBase; | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| while (frameAncestor) { | ||||||||||||||||||||||||||||||||||||||||||
| frameAncestor = <FrameBase>getAncestor(frameAncestor, FrameBase); | ||||||||||||||||||||||||||||||||||||||||||
| frameAncestor = getAncestor(frameAncestor, FrameBase); | ||||||||||||||||||||||||||||||||||||||||||
| if (frameAncestor === parentFrameCandidate) { | ||||||||||||||||||||||||||||||||||||||||||
| return true; | ||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.