Refresh main page after modal was closed by the user #152
-
|
My main page doesn't update automatically. When a user clicks an item, makes some changes there and then drags the modal down to close it there will be outdated information on the page. How can I refresh the main page? I tried different things with My current {
"settings": {},
"rules": [
{
"patterns": [
".*"
],
"properties": {
"context": "default",
"pull_to_refresh_enabled": true,
// screen stays black when this is enabled:
// "presentation": "refresh"
}
},
{
"patterns": [
"/my-item-path-pattern"
],
"properties": {
"context": "modal",
"pull_to_refresh_enabled": false,
// enabling this breaks the modal open and stays on the same page:
// "presentation": "refresh"
}
}
]
} |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 16 replies
-
|
If the "changes" made in the modal use non-GET requests then they should bust the snapshot cache. Then, when the modal is dismissed, the page showing underneath with automatically reload. |
Beta Was this translation helpful? Give feedback.
-
|
I also ran into this issue and have been looking into a viable solution, mainly from the front-end perspective. So here's another (less-than-ideal) approach, but it might spark some ideas… The idea is to create a const clear = Turbo.cache.clear
Turbo.cache.clear = () => {
clear.call(Turbo.cache)
this.broadcastChannel.postMessage({ type: 'turbo:cache-cleared' })
}The main or modal webview can then listen for I also experimented with the |
Beta Was this translation helpful? Give feedback.
-
|
Hi! I thought it's what Using the following: Simulator.Screen.Recording.-.iPhone.17.mov |
Beta Was this translation helpful? Give feedback.
Thanks! That's super helpful.
Long story short, you can fix your issue by making the modal "full screen", like so.