chore: rotate model hub banner on app launch until set #4542
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Describe Your Changes
As designed, users will see a different Model Hub banner every time they reopen the app if they haven't set any banner. This PR is for that.
Fixes Issues
Self Checklist
This pull request introduces changes to the
web/helpers/atoms/App.atom.ts
andweb/screens/Hub/index.tsx
files to enhance the management of the app banner hub settings. The most important changes include renaming and refactoring atoms for better clarity, adding new atoms for retrieving and setting the banner, and updating theHub
screen to use these new atoms.Refactoring and renaming atoms:
web/helpers/atoms/App.atom.ts
: RenamedappBannerHubAtom
toappBannerHubStorageAtom
and changed its type tostring | undefined
. Added new atomsgetAppBannerHubAtom
for retrieving the banner andsetAppBannerHubAtom
for setting the banner.Updating imports and usage in
Hub
screen:web/screens/Hub/index.tsx
: Updated imports to use the new atomsgetAppBannerHubAtom
andsetAppBannerHubAtom
instead ofappBannerHubAtom
.web/screens/Hub/index.tsx
: Modified theHubScreen
component to useuseAtomValue
forgetAppBannerHubAtom
anduseSetAtom
forsetAppBannerHubAtom
.Additional import adjustments:
web/screens/Hub/index.tsx
: AddeduseAtomValue
to the list of imports fromjotai
.