chore: reset palette state

This commit is contained in:
Aslam H
2024-10-22 21:29:08 +07:00
parent 2e00e9d692
commit adbb9a6b95
4 changed files with 11 additions and 6 deletions

View File

@@ -149,6 +149,13 @@ export function RealCommandPalette() {
[bounce, setOpen],
)
React.useEffect(() => {
if (!open) {
setInputValue("")
setActivePage("home")
}
}, [open, setActivePage, setInputValue])
const filteredCommands = React.useMemo(
() => getFilteredCommands(),
[getFilteredCommands],

View File

@@ -1,9 +1,5 @@
import * as React from "react"
import {
useAccount,
useAccountOrGuest,
useCoState,
} from "@/lib/providers/jazz-provider"
import { useAccountOrGuest, useCoState } from "@/lib/providers/jazz-provider"
import { LaIcon } from "@/components/custom/la-icon"
import { Topic, PersonalLink, PersonalPage } from "@/lib/schema"
import { PublicGlobalGroup } from "@/lib/schema/master/public-group"