[feat] optimization for getting cs2 path + add Toast for auto path
This commit is contained in:
@@ -42,15 +42,18 @@ const Nav = () => {
|
||||
const router = useRouter()
|
||||
const pathname = usePathname()
|
||||
|
||||
const app = useAppStore()
|
||||
|
||||
return (
|
||||
<nav className="absolute top-0 right-0 flex flex-row h-16 gap-0.5 p-4" data-tauri-drag-region>
|
||||
<ResetModal />
|
||||
|
||||
{pathname !== "/" && (
|
||||
<button
|
||||
type="button"
|
||||
className="px-2 py-0 transition duration-150 rounded hover:bg-zinc-200/80 dark:hover:bg-zinc-100/10 active:scale-95"
|
||||
onClick={() => (pathname !== "/" ? router.push("/") : router.back())}
|
||||
onClick={() => {
|
||||
app.setInited(false)
|
||||
if(pathname !== "/") router.push("/")
|
||||
}}
|
||||
>
|
||||
<RocketOne size={16} />
|
||||
</button>
|
||||
@@ -64,6 +67,8 @@ const Nav = () => {
|
||||
{theme === "light" ? <SunOne size={16} /> : <Moon size={16} />}
|
||||
</button>
|
||||
|
||||
<ResetModal />
|
||||
|
||||
{/* { platform() === "windows" && ( */}
|
||||
<>
|
||||
<button
|
||||
@@ -127,9 +132,7 @@ function ResetModal() {
|
||||
<>
|
||||
<ModalHeader className="flex flex-col gap-1">重置设置</ModalHeader>
|
||||
<ModalBody>
|
||||
<p>
|
||||
确认后会恢复CS工具箱的偏好设置为默认设置
|
||||
</p>
|
||||
<p>确认后会恢复CS工具箱的偏好设置为默认设置</p>
|
||||
</ModalBody>
|
||||
<ModalFooter>
|
||||
<Button color="danger" variant="light" onPress={onClose}>
|
||||
|
||||
Reference in New Issue
Block a user