Revert shownOnce name change

This commit is contained in:
Angie Ta
2025-06-20 10:26:25 -07:00
parent 7d72bdb587
commit 0fc130f640
3 changed files with 9 additions and 9 deletions

View File

@@ -17,7 +17,7 @@ import useStore from "stores/useStore";
/* eslint-disable i18next/no-literal-string */
/* eslint-disable react/no-unescaped-entities */
const Buttons = ( ) => {
const resetShownOnce = useStore( state => state.layout.resetOnboardingShownOnce );
const resetShownOnce = useStore( state => state.layout.resetShownOnce );
const [modalIndex, setModalIndex] = useState( -1 );
const setShowingModal = index => {

View File

@@ -45,8 +45,8 @@ const OnboardingModal = ( {
const { t } = useTranslation( );
// Controls wether to show the modal, and to show it only once to the user
const shownOnce = useStore( state => state.layout.onboardingShownOnce );
const setShownOnce = useStore( state => state.layout.setOnboardingShownOnce );
const shownOnce = useStore( state => state.layout.shownOnce );
const setShownOnce = useStore( state => state.layout.setShownOnce );
const showModal = !shownOnce[showKey] && triggerCondition;
const closeModal = () => {
setShownOnce( showKey );

View File

@@ -60,20 +60,20 @@ const createLayoutSlice = set => ( {
}
} ) ),
// State to control pivot cards and other onboarding material being shown only once
onboardingShownOnce: {},
setOnboardingShownOnce: ( key: string ) => set( state => ( {
shownOnce: {},
setShownOnce: ( key: string ) => set( state => ( {
layout: {
...state.layout,
onboardingShownOnce: {
...state.layout.onboardingShownOnce,
shownOnce: {
...state.layout.shownOnce,
[key]: true
}
}
} ) ),
resetOnboardingShownOnce: () => set( state => ( {
resetShownOnce: () => set( state => ( {
layout: {
...state.layout,
onboardingShownOnce: {}
shownOnce: {}
}
} ) ),
// State to control login/signup banner being only shown once until dismissed by user