Skip to content
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

fix: Do not setUri on HomeView's blur if no trackedWebviewInnerUri #423

Merged
merged 1 commit into from
Sep 22, 2022

Conversation

Ldoppea
Copy link
Member

@Ldoppea Ldoppea commented Sep 21, 2022

#82 introduced trackedWebviewInnerUri state to keep track of WebView's URI

On HomeView's blur, we would synchronize latest
trackedWebviewInnerUri state into the uri state

If the first user's action into the WebView is to open a cozy-app, then the HomeView's would blur with trackedWebviewInnerUri being null (because no navigation occurred inside of the WebView to trigger the setTrackedWebviewInnerUri event)

This would result to calling setUri(null) in the blur event

This behaviour was invisible to the user as uri would be set to cozy-home's root URL directly after that

But a side effect of this is the CozyProxyWebView being unmount and remount, which would trigger the index.html generation process, which is unwanted

By conditionally calling setUri based on trackedWebviewInnerUri nullity will prevent this behaviour

#82 introduced `trackedWebviewInnerUri` state to keep track of
WebView's URI

On HomeView's blur, we would synchronize latest
`trackedWebviewInnerUri` state into the `uri` state

If the first user's action into the WebView is to open a cozy-app, then
the HomeView's would blur with `trackedWebviewInnerUri` being null
(because no navigation occurred inside of the WebView to trigger the
`setTrackedWebviewInnerUri` event)

This would result to calling `setUri(null)` in the blur event

This behaviour was invisible to the user as `uri` would be set to
cozy-home's root URL directly after that

But a side effect of this is the CozyProxyWebView being unmount and
remount, which would trigger the `index.html` generation process, which
is unwanted

By conditionally calling `setUri` based on `trackedWebviewInnerUri`
nullity will prevent this behaviour
@Ldoppea Ldoppea merged commit 9848a0b into master Sep 22, 2022
@Ldoppea Ldoppea deleted the fix/prevent_seturi_null branch September 22, 2022 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants