SvenTiigi / WhatsNewKit

Showcase your awesome new app features 📱
https://sventiigi.github.io/WhatsNewKit/
MIT License
3.92k stars 193 forks source link

Can't get initial whatsNewCollection to show again #71

Closed pkasson closed 9 months ago

pkasson commented 1 year ago

What happened?

I have changed the version store to use user defaults and used that in the .environment call ... but the initial what's new that is created in the App class, never reappears.

.environment(\.whatsNew, .init(versionStore: userDefaultsWhatsNewVersionStore, whatsNewCollection: self))

Also tried to subclass the WhatsNewEnvironment ... but not clear how to pass in a new WhatsNew object, OR, at least then while testing, how to revert back to contents of an existing version to get the content to be correct before publishing.

Thanks !

What are the steps to reproduce?

Outlined above.

What is the expected behavior?

Should have the initial what's new content to reappear

boehs commented 10 months ago

64 ?

SvenTiigi commented 9 months ago

Hi @pkasson,

The default behavior of the WhatsNewEnvironment in combination with a WhatsNewVersionStore is that a version is presented only once to a user.

Additionally, the default WhatsNewEnvironment includes the following fallback mechanism as described in the README:

[...] the WhatsNewEnvironment includes a fallback for patch versions. For example when a user installs version 1.0.1 and you only have declared a WhatsNew for version 1.0.0 the environment will automatically fallback to version 1.0.0 and present the WhatsNewView to the user if needed.

If you like to change this behavior please feel free to subclass the WhatsNewEnvironment or provide your own implementation of the WhatsNewVersionStore.

Alternatively, you can make use of the remove(presentedVersion:) function on an instance of UserDefaultsWhatsNewVersionStore as highlighted by @boehs

SvenTiigi commented 9 months ago

Closing due inactivity. Please feel free to re-open the issue at any time.