Skip to content
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

Can't get initial whatsNewCollection to show again #71

Closed
pkasson opened this issue Oct 4, 2023 · 3 comments
Closed

Can't get initial whatsNewCollection to show again #71

pkasson opened this issue Oct 4, 2023 · 3 comments
Assignees
Labels
question Further information is requested

Comments

@pkasson
Copy link

pkasson commented Oct 4, 2023

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 pkasson added the bug Something isn't working label Oct 4, 2023
@boehs
Copy link

boehs commented Dec 30, 2023

#64 ?

@SvenTiigi
Copy link
Owner

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 SvenTiigi added question Further information is requested and removed bug Something isn't working labels Jan 18, 2024
@SvenTiigi
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants