WhatsNewKit icon indicating copy to clipboard operation
WhatsNewKit copied to clipboard

Can't get initial whatsNewCollection to show again

Open pkasson opened this issue 1 year ago • 2 comments

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

pkasson avatar Oct 04 '23 10:10 pkasson

#64 ?

boehs avatar Dec 30 '23 08:12 boehs

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 avatar Jan 18 '24 18:01 SvenTiigi

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

SvenTiigi avatar Feb 01 '24 19:02 SvenTiigi