Closed twodayslate closed 3 years ago
Perhaps the story gets deallocated and the state changes - since the sheet doesn't have a reload button there is no way to refresh the page. Might need to check if the story is loaded at didAppear
edit: The story fetcher is getting deallocated
It was actually an issue using ObservableObject. Switching to a StateObject did the trick.
The view hit the onAppear but then was reloaded so the load never fired on the new ObservableObject. StateObject fixes this cause it isn't refreshed.
See https://sarunw.com/posts/how-to-initialize-stateobject-with-parameters-in-swiftui/ and https://stackoverflow.com/a/66463103/193772
Closes #44
For some reason when you swipe to go back when the story is in a sheet (similar testing to #22 and #26) the story disappears. If you use the close button it doesn't. If I print the onDismiss that also get's called twice (sounds like something similar to https://github.com/stleamist/BetterSafariView/issues/15 although I don't know the fix). If I try to put SafariView on ContentView I get similar bugs to #26. This could be #21 but I don't understand why it would be fine for the close button but not swipe.
Other research for this ticket: