From a9fab6d4feced026c8aecf71f803ea6397bded05 Mon Sep 17 00:00:00 2001 From: Nebelung Date: Sun, 13 Oct 2024 22:03:51 +0000 Subject: [PATCH 1/3] fix navbar --- src/components/navbar.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/navbar.tsx b/src/components/navbar.tsx index 66d551a..638a717 100644 --- a/src/components/navbar.tsx +++ b/src/components/navbar.tsx @@ -15,7 +15,7 @@ export default function Navbar() { if (pathname && pathname.includes('/go/')) return null return ( -
+
+ + + + +
+ + +
+
+ ); +} From c35930952d179a1ebfbf0f2bd4cc8e103fd88b9c Mon Sep 17 00:00:00 2001 From: Nebelung Date: Sun, 13 Oct 2024 22:55:04 +0000 Subject: [PATCH 3/3] show current wisp server --- src/app/settings/layout.tsx | 2 +- src/app/settings/wisp/page.tsx | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/app/settings/layout.tsx b/src/app/settings/layout.tsx index fa78337..80639ad 100644 --- a/src/app/settings/layout.tsx +++ b/src/app/settings/layout.tsx @@ -30,7 +30,7 @@ export default function SettingsLayout({ } className="w-full items-center justify-start gap-2" > - Wisp Switcher + Wisp diff --git a/src/app/settings/wisp/page.tsx b/src/app/settings/wisp/page.tsx index e5a48e1..f4c7cbb 100644 --- a/src/app/settings/wisp/page.tsx +++ b/src/app/settings/wisp/page.tsx @@ -17,7 +17,7 @@ import { import { Input } from "@/components/ui/input"; import { Separator } from "@/components/ui/separator"; import { Save, RotateCcw } from "lucide-react"; -import { useState } from "react"; +import { useEffect, useState } from "react"; import { toast } from "sonner"; const formSchema = z.object({ @@ -34,6 +34,16 @@ export default function WispSwitcher() { }, }); + useEffect(() => { + const wispServer: string = window.chemical.getStore("wisp"); + const defaultWisp: string = + (location.protocol === "https:" ? "wss" : "ws") + + "://" + + location.host + + "/wisp/"; + form.setValue("wispServer", wispServer !== defaultWisp ? wispServer : ""); + }, []); + function onSubmit(values: z.infer) { setSubmitting(true); @@ -53,7 +63,7 @@ export default function WispSwitcher() { return (
-

Wisp Switcher

+

Wisp

@@ -66,7 +76,7 @@ export default function WispSwitcher() { name="wispServer" render={({ field }) => ( - Wisp Server + Wisp Server Switcher