-
Notifications
You must be signed in to change notification settings - Fork 1
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: Stabilize opening connectors on the HomeView #82
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ldoppea
force-pushed
the
fix/stabilize-connectors-opening-from-store
branch
2 times, most recently
from
February 10, 2022 10:47
13bfe90
to
44c1b3d
Compare
acezard
reviewed
Feb 10, 2022
#74 introduced the ability to open a connector from the cozy-store webview This implementation had a side effect as the requested connector was kept in the application state which would trigger the connector display after each re-render For example if the user opens a connector from the store, closes it and the navigate to cozy-drive, then when navigating back to the Home, the connector would be displayed again To prevent this we now keep track of the webview's url in real time and then use the navigation's `focus` and `blur` events to fix the rendered url on the native context We also clear the navigation `konnector` param when consumed. Which would prevent an unexpected re-render of the connector after closing it This new implementation does not need to inject a javascript chunk to handle the navigation, so we deleted `interceptHashAndNavigate` method
Ldoppea
force-pushed
the
fix/stabilize-connectors-opening-from-store
branch
from
February 22, 2022 18:44
44c1b3d
to
b8fa33b
Compare
acezard
approved these changes
Feb 23, 2022
Ldoppea
added a commit
that referenced
this pull request
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
Ldoppea
added a commit
that referenced
this pull request
Sep 22, 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#74 introduced the ability to open a connector from the cozy-store
webview
This implementation had a side effect as the requested connector was
kept in the application state which would trigger the connector display
after each re-render
For example if the user opens a connector from the store, closes it and
the navigate to cozy-drive, then when navigating back to the Home, the
connector would be displayed again
To prevent this we now keep track of the webview's url in real time and
then use the navigation's
focus
andblur
events to fix the renderedurl on the native context
We also clear the navigation
konnector
param when consumed. Whichwould prevent an unexpected re-render of the connector after closing it
This new implementation does not need to inject a javascript chunk to
handle the navigation, so we deleted
interceptHashAndNavigate
method