improv: state from local storage
This commit is contained in:
parent
8f2095d10b
commit
be662c2284
3 changed files with 8 additions and 2 deletions
|
|
@ -2,6 +2,7 @@ import { ChevronRightIcon } from "@heroicons/react/24/outline";
|
|||
import { Button, ButtonSubtext } from "..";
|
||||
import { useAppDispatch, useAppSelector } from "../../redux/hooks";
|
||||
import { setIsExploreDialogOpen } from "../../redux/slices/uiSlice";
|
||||
import { setLocalStorage } from "../../util/localStorage";
|
||||
import { ReusableCard } from "../ReusableCard";
|
||||
|
||||
export function ExploreHubCard() {
|
||||
|
|
@ -13,7 +14,10 @@ export function ExploreHubCard() {
|
|||
return (
|
||||
<ReusableCard
|
||||
showCloseButton={true}
|
||||
onClose={() => dispatch(setIsExploreDialogOpen(false))}
|
||||
onClose={() => {
|
||||
setLocalStorage("isExploreDialogOpen", false);
|
||||
return dispatch(setIsExploreDialogOpen(false));
|
||||
}}
|
||||
>
|
||||
<div className="flex flex-col items-center gap-1 p-4 text-center">
|
||||
<h2 className="text-2xl font-semibold">Create Your Own Assistant</h2>
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import {
|
|||
defaultOnboardingCardState,
|
||||
OnboardingCardState,
|
||||
} from "../../components/OnboardingCard";
|
||||
import { getLocalStorage } from "../../util/localStorage";
|
||||
|
||||
type ToolSetting =
|
||||
| "allowedWithPermission"
|
||||
|
|
@ -32,7 +33,7 @@ export const uiSlice = createSlice({
|
|||
dialogMessage: "",
|
||||
dialogEntryOn: false,
|
||||
onboardingCard: defaultOnboardingCardState,
|
||||
isExploreDialogOpen: false,
|
||||
isExploreDialogOpen: getLocalStorage("isExploreDialogOpen"),
|
||||
shouldAddFileForEditing: false,
|
||||
ttsActive: false,
|
||||
useTools: false,
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ import { JSONContent } from "@tiptap/react";
|
|||
import { OnboardingStatus } from "../components/OnboardingCard";
|
||||
|
||||
type LocalStorageTypes = {
|
||||
isExploreDialogOpen: boolean;
|
||||
onboardingStatus?: OnboardingStatus;
|
||||
hasDismissedOnboardingCard: boolean;
|
||||
mainTextEntryCounter: number;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue