mirror of
https://github.com/tiennm99/goclaw.git
synced 2026-10-13 10:15:48 +00:00
feat(setup): add skip setup option with localStorage persistence
Users can skip the entire setup wizard via a link below the title. Sets localStorage flag so refresh won't re-show the wizard.
This commit is contained in:
1 parent
5ab4af415d
commit
050de16aa2
2 files changed
+20
No files matched your search
@@ -22,6 +22,10 @@ export function useBootstrapStatus() {
|
||||
(p.api_key === "***" || p.provider_type === "claude_cli" || p.provider_type === "chatgpt_oauth" || p.provider_type === "ollama"));
|
||||
const hasAgent = agents.length > 0;
|
||||
|
||||
// Allow skipping setup entirely via localStorage
|
||||
const skipped = localStorage.getItem("setup_skipped") === "1";
|
||||
if (skipped) return { needsSetup: false, currentStep: "complete" as SetupStep };
|
||||
|
||||
if (!hasProvider) return { needsSetup: true, currentStep: 1 as SetupStep };
|
||||
if (!hasAgent) return { needsSetup: true, currentStep: 2 as SetupStep };
|
||||
return { needsSetup: false, currentStep: "complete" as SetupStep };
|
||||
|
||||
@@ -1,7 +1,16 @@
|
||||
import { useNavigate } from "react-router";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { ROUTES } from "@/lib/constants";
|
||||
|
||||
export function SetupLayout({ children }: { children: React.ReactNode }) {
|
||||
const { t } = useTranslation("setup");
|
||||
const navigate = useNavigate();
|
||||
|
||||
const handleSkipSetup = () => {
|
||||
localStorage.setItem("setup_skipped", "1");
|
||||
navigate(ROUTES.OVERVIEW, { replace: true });
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="flex min-h-dvh items-center justify-center bg-background px-4 py-8">
|
||||
<div className="w-full max-w-2xl space-y-6">
|
||||
@@ -10,6 +19,13 @@ export function SetupLayout({ children }: { children: React.ReactNode }) {
|
||||
<p className="mt-2 text-sm text-muted-foreground">
|
||||
{t("layout.subtitle", "Let's get your gateway up and running")}
|
||||
</p>
|
||||
<button
|
||||
type="button"
|
||||
onClick={handleSkipSetup}
|
||||
className="mt-1 text-xs text-muted-foreground/60 underline-offset-2 hover:text-muted-foreground hover:underline"
|
||||
>
|
||||
{t("layout.skipSetup", "Skip setup and go to dashboard")}
|
||||
</button>
|
||||
</div>
|
||||
{children}
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user