More stuff

This commit is contained in:
Jon Staab
2026-03-27 14:08:05 -07:00
parent bc45017222
commit 77ea366c69
12 changed files with 103 additions and 186 deletions
+2
View File
@@ -2,6 +2,7 @@ import { createEffect, Show } from "solid-js"
import { Router, Route, useLocation, useNavigate } from "@solidjs/router" import { Router, Route, useLocation, useNavigate } from "@solidjs/router"
import type { Component } from "solid-js" import type { Component } from "solid-js"
import AppShell from "@/components/AppShell" import AppShell from "@/components/AppShell"
import Toast from "@/components/Toast"
import Home from "@/pages/Home" import Home from "@/pages/Home"
import RelayList from "@/pages/relays/RelayList" import RelayList from "@/pages/relays/RelayList"
import RelayNew from "@/pages/relays/RelayNew" import RelayNew from "@/pages/relays/RelayNew"
@@ -31,6 +32,7 @@ function Layout(props: { children?: any }) {
<Show when={!identity.loading && identity() && usesAppShell()} fallback={<main>{props.children}</main>}> <Show when={!identity.loading && identity() && usesAppShell()} fallback={<main>{props.children}</main>}>
<AppShell>{props.children}</AppShell> <AppShell>{props.children}</AppShell>
</Show> </Show>
<Toast />
</div> </div>
) )
} }
+1 -1
View File
@@ -7,7 +7,7 @@ export default function Navbar() {
const picture = useProfilePicture(() => account()?.pubkey) const picture = useProfilePicture(() => account()?.pubkey)
return ( return (
<nav class="bg-white border-b border-gray-200"> <nav class="fixed inset-0 h-screen bg-white border-b border-gray-200 z-40">
<div class="max-w-4xl mx-auto px-4 h-14 flex items-center justify-between"> <div class="max-w-4xl mx-auto px-4 h-14 flex items-center justify-between">
<A href={account() ? "/relays" : "/"} class="flex items-center gap-2"> <A href={account() ? "/relays" : "/"} class="flex items-center gap-2">
<img src="/caravel.png" alt={PLATFORM_NAME} class="h-8 w-8 rounded-full object-cover" /> <img src="/caravel.png" alt={PLATFORM_NAME} class="h-8 w-8 rounded-full object-cover" />
+4 -4
View File
@@ -1,6 +1,6 @@
import { A } from "@solidjs/router" import { A } from "@solidjs/router"
import { For } from "solid-js" import { For } from "solid-js"
import { RELAY_PLANS, type RelayPlanId } from "@/lib/relayPlans" import { PLANS, type PlanId } from "@/lib/api"
function CheckIcon() { function CheckIcon() {
return ( return (
@@ -22,8 +22,8 @@ function XIcon() {
type PricingTableProps = { type PricingTableProps = {
selectable?: boolean selectable?: boolean
selectedPlan?: RelayPlanId selectedPlan?: PlanId
onSelect?: (plan: RelayPlanId) => void onSelect?: (plan: PlanId) => void
ctaHref?: string ctaHref?: string
compactOnMobile?: boolean compactOnMobile?: boolean
} }
@@ -31,7 +31,7 @@ type PricingTableProps = {
export default function PricingTable(props: PricingTableProps) { export default function PricingTable(props: PricingTableProps) {
return ( return (
<div class={`grid items-start ${props.compactOnMobile ? "grid-cols-3 gap-2 sm:grid-cols-1 sm:gap-6 md:grid-cols-3" : "grid-cols-1 md:grid-cols-3 gap-6"}`}> <div class={`grid items-start ${props.compactOnMobile ? "grid-cols-3 gap-2 sm:grid-cols-1 sm:gap-6 md:grid-cols-3" : "grid-cols-1 md:grid-cols-3 gap-6"}`}>
<For each={RELAY_PLANS}> <For each={PLANS}>
{(plan) => { {(plan) => {
const isPopular = plan.id === "basic" const isPopular = plan.id === "basic"
const isSelected = () => props.selectable && props.selectedPlan === plan.id const isSelected = () => props.selectable && props.selectedPlan === plan.id
+32 -103
View File
@@ -1,10 +1,8 @@
import { A } from "@solidjs/router" import { A } from "@solidjs/router"
import { Show, createEffect, createSignal, onCleanup } from "solid-js" import { Show, createEffect, createSignal, onCleanup } from "solid-js"
import type { Relay } from "@/lib/api" import type { Relay, PlanId } from "@/lib/api"
import menuDotsIcon from "@/assets/menu-dots-2.svg" import menuDotsIcon from "@/assets/menu-dots-2.svg"
import Modal from "@/components/Modal"
import PricingTable from "@/components/PricingTable" import PricingTable from "@/components/PricingTable"
import { RELAY_PLAN_IDS, type RelayPlanId } from "@/lib/relayPlans"
function Field(props: { label: string; children: any }) { function Field(props: { label: string; children: any }) {
return ( return (
@@ -89,8 +87,7 @@ type RelayDetailCardProps = {
onToggleMediaStorage?: () => void onToggleMediaStorage?: () => void
onToggleLivekitSupport?: () => void onToggleLivekitSupport?: () => void
onTogglePushNotifications?: () => void onTogglePushNotifications?: () => void
onUpdatePlan?: (plan: RelayPlanId) => Promise<void> onUpdatePlan?: (plan: PlanId) => Promise<void>
updatingPlan?: boolean
enforcePlanLimits?: boolean enforcePlanLimits?: boolean
showPlanActions?: boolean showPlanActions?: boolean
} }
@@ -103,10 +100,8 @@ export default function RelayDetailCard(props: RelayDetailCardProps) {
return fallback return fallback
} }
const [menuOpen, setMenuOpen] = createSignal(false) const [menuOpen, setMenuOpen] = createSignal(false)
const [planModalOpen, setPlanModalOpen] = createSignal(false) const [plan, setPlan] = createSignal<PlanId>(props.relay.plan)
const [selectedPlan, setSelectedPlan] = createSignal<RelayPlanId>("free")
const [planError, setPlanError] = createSignal("")
const [submittingPlan, setSubmittingPlan] = createSignal(false)
let menuContainerRef: HTMLDivElement | undefined let menuContainerRef: HTMLDivElement | undefined
const memberLimitByPlan: Record<string, string> = { const memberLimitByPlan: Record<string, string> = {
@@ -116,32 +111,12 @@ export default function RelayDetailCard(props: RelayDetailCardProps) {
} }
const memberLimitLabel = () => memberLimitByPlan[r().plan] ?? "?" const memberLimitLabel = () => memberLimitByPlan[r().plan] ?? "?"
const isTopTier = () => r().plan === "growth"
const planLimited = () => (props.enforcePlanLimits ?? true) && r().plan === "free" const planLimited = () => (props.enforcePlanLimits ?? true) && r().plan === "free"
const showPlanActions = () => props.showPlanActions ?? true const showPlanActions = () => props.showPlanActions ?? true
createEffect(() => { async function changePlan(plan: PlanId) {
if (!planModalOpen()) return setPlan(plan)
const current = RELAY_PLAN_IDS.find((id) => id === r().plan) ?? "free" props.onUpdatePlan?.(plan)
setSelectedPlan(current)
setPlanError("")
})
const canSubmitPlan = () => selectedPlan() !== r().plan
async function handlePlanContinue() {
if (!props.onUpdatePlan || submittingPlan() || !canSubmitPlan()) return
setPlanError("")
setSubmittingPlan(true)
try {
await props.onUpdatePlan(selectedPlan())
setPlanModalOpen(false)
} catch (e) {
setPlanError(e instanceof Error ? e.message : "Failed to update plan")
} finally {
setSubmittingPlan(false)
}
} }
createEffect(() => { createEffect(() => {
@@ -286,13 +261,9 @@ export default function RelayDetailCard(props: RelayDetailCardProps) {
</A> </A>
} }
> >
<button <span class="inline-flex items-center rounded-lg border border-blue-200 bg-blue-50 px-3 py-1.5 text-xs font-medium text-blue-700">
type="button"
class="inline-flex items-center rounded-lg border border-blue-200 bg-blue-50 px-3 py-1.5 text-xs font-medium text-blue-700 hover:bg-blue-100"
onClick={() => setPlanModalOpen(true)}
>
Update Plan Update Plan
</button> </span>
</Show> </Show>
</Show> </Show>
} }
@@ -319,13 +290,9 @@ export default function RelayDetailCard(props: RelayDetailCardProps) {
</A> </A>
} }
> >
<button <span class="inline-flex items-center rounded-lg border border-blue-200 bg-blue-50 px-3 py-1.5 text-xs font-medium text-blue-700">
type="button"
class="inline-flex items-center rounded-lg border border-blue-200 bg-blue-50 px-3 py-1.5 text-xs font-medium text-blue-700 hover:bg-blue-100"
onClick={() => setPlanModalOpen(true)}
>
Update Plan Update Plan
</button> </span>
</Show> </Show>
</Show> </Show>
} }
@@ -352,69 +319,31 @@ export default function RelayDetailCard(props: RelayDetailCardProps) {
<span class="font-mono text-xs break-all">{r().tenant}</span> <span class="font-mono text-xs break-all">{r().tenant}</span>
</Field> </Field>
</Show> </Show>
<Show when={props.editHref && showPlanActions()}>
<Field label=" ">
<Show
when={props.onUpdatePlan}
fallback={
<Show
when={!isTopTier()}
fallback={<span />}
>
<A
href={props.editHref!}
class="inline-flex items-center rounded-lg border border-blue-200 bg-blue-50 px-3 py-1.5 text-xs font-medium text-blue-700 hover:bg-blue-100"
>
Upgrade Plan
</A>
</Show>
}
>
<button
type="button"
class="inline-flex items-center rounded-lg border border-blue-200 bg-blue-50 px-3 py-1.5 text-xs font-medium text-blue-700 hover:bg-blue-100"
onClick={() => setPlanModalOpen(true)}
>
Update Plan
</button>
</Show>
</Field>
</Show>
</MembershipSection> </MembershipSection>
<Modal <Show when={showPlanActions()}>
open={planModalOpen()} <hr class="border-gray-200" />
onClose={() => setPlanModalOpen(false)}
wrapperClass="fixed inset-0 z-40 flex items-center justify-center bg-black/40 p-4"
panelClass="w-full max-w-5xl max-h-[90vh] overflow-y-auto rounded-2xl bg-white"
>
<div class="p-6 sm:p-8">
<h2 class="text-2xl font-bold text-gray-900 mb-2">Update plan</h2>
<p class="text-sm text-gray-500 mb-8">Choose the plan you want for this relay.</p>
<PricingTable <DetailSection title="Plan">
selectable <Show
compactOnMobile when={props.onUpdatePlan}
selectedPlan={selectedPlan()} fallback={
onSelect={setSelectedPlan} <Field label="Current plan">
/> <span class="capitalize text-gray-900">{r().plan}</span>
</Field>
<Show when={planError()}> }
<p class="mt-4 text-sm text-red-600">{planError()}</p> >
<div class="lg:col-span-2 space-y-4">
<PricingTable
selectable
compactOnMobile
selectedPlan={plan()}
onSelect={changePlan}
/>
</div>
</Show> </Show>
</DetailSection>
<div class="mt-8"> </Show>
<button
type="button"
onClick={() => void handlePlanContinue()}
disabled={!canSubmitPlan() || submittingPlan() || !!props.updatingPlan}
class="w-full py-3 rounded-xl bg-blue-600 text-white font-semibold hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed"
>
{submittingPlan() || props.updatingPlan ? "Updating..." : "Continue"}
</button>
</div>
</div>
</Modal>
</div> </div>
) )
} }
+11 -6
View File
@@ -2,6 +2,7 @@ import { createEffect, createSignal } from "solid-js"
import type { Relay } from "@/lib/hooks" import type { Relay } from "@/lib/hooks"
import { slugify } from "@/lib/slugify" import { slugify } from "@/lib/slugify"
import { PLANS } from "@/lib/api" import { PLANS } from "@/lib/api"
import { setToastMessage } from "@/components/Toast"
export type RelayFormValues = Pick<Relay, "info_name" | "subdomain" | "info_icon" | "info_description" | "plan"> export type RelayFormValues = Pick<Relay, "info_name" | "subdomain" | "info_icon" | "info_description" | "plan">
@@ -14,17 +15,22 @@ type RelayFormProps = {
} }
export default function RelayForm(props: RelayFormProps) { export default function RelayForm(props: RelayFormProps) {
const [plan, setPlan] = createSignal(props.initialValues?.plan ?? "") const [plan, setPlan] = createSignal(props.initialValues?.plan ?? PLANS[0].id)
const [name, setName] = createSignal(props.initialValues?.info_name ?? "") const [name, setName] = createSignal(props.initialValues?.info_name ?? "")
const [subdomain, setSubdomain] = createSignal(props.initialValues?.subdomain ?? "") const [subdomain, setSubdomain] = createSignal(props.initialValues?.subdomain ?? "")
const [icon, setIcon] = createSignal(props.initialValues?.info_icon ?? "") const [icon, setIcon] = createSignal(props.initialValues?.info_icon ?? "")
const [description, setDescription] = createSignal(props.initialValues?.info_description ?? "") const [description, setDescription] = createSignal(props.initialValues?.info_description ?? "")
const [submitting, setSubmitting] = createSignal(false) const [submitting, setSubmitting] = createSignal(false)
const [error, setError] = createSignal("")
async function handleSubmit(e: Event) { async function handleSubmit(e: Event) {
e.preventDefault() e.preventDefault()
setError("")
if (!plan()) {
setToastMessage("Please select a plan")
return
}
setToastMessage("")
setSubmitting(true) setSubmitting(true)
try { try {
@@ -36,7 +42,7 @@ export default function RelayForm(props: RelayFormProps) {
info_description: description(), info_description: description(),
}) })
} catch (e) { } catch (e) {
setError(e instanceof Error ? e.message : "Failed to save relay") setToastMessage(e instanceof Error ? e.message : "Failed to save relay")
} finally { } finally {
setSubmitting(false) setSubmitting(false)
} }
@@ -106,12 +112,11 @@ export default function RelayForm(props: RelayFormProps) {
<div class="text-sm text-gray-500 mt-1"> <div class="text-sm text-gray-500 mt-1">
{p.price === 0 ? "Free" : `${p.price.toLocaleString()} sats/mo`} {p.price === 0 ? "Free" : `${p.price.toLocaleString()} sats/mo`}
</div> </div>
<div class="text-xs text-gray-500 mt-2">{p.members} members</div> <div class="text-xs text-gray-500 mt-2">{p.memberLabel}</div>
</button> </button>
))} ))}
</div> </div>
</div> </div>
{error() && <p class="text-sm text-red-600">{error()}</p>}
<button <button
type="submit" type="submit"
disabled={submitting()} disabled={submitting()}
+7 -11
View File
@@ -1,12 +1,8 @@
import { Show, createEffect, createSignal, onCleanup } from "solid-js" import { Show, createEffect, createSignal, onCleanup } from "solid-js"
type ToastProps = { export const [toastMessage, setToastMessage] = createSignal("")
message?: string
duration?: number
onClear?: () => void
}
export default function Toast(props: ToastProps) { export default function Toast() {
const [visible, setVisible] = createSignal(false) const [visible, setVisible] = createSignal(false)
let hideTimer: number | undefined let hideTimer: number | undefined
@@ -26,7 +22,7 @@ export default function Toast(props: ToastProps) {
} }
createEffect(() => { createEffect(() => {
const message = props.message?.trim() const message = toastMessage()?.trim()
clearTimers() clearTimers()
if (!message) { if (!message) {
@@ -46,11 +42,11 @@ export default function Toast(props: ToastProps) {
hideTimer = window.setTimeout(() => { hideTimer = window.setTimeout(() => {
setVisible(false) setVisible(false)
clearTimer = window.setTimeout(() => { clearTimer = window.setTimeout(() => {
props.onClear?.() setToastMessage("")
clearTimer = undefined clearTimer = undefined
}, 250) }, 250)
hideTimer = undefined hideTimer = undefined
}, props.duration ?? 10_000) }, 10_000)
}) })
onCleanup(() => { onCleanup(() => {
@@ -58,7 +54,7 @@ export default function Toast(props: ToastProps) {
}) })
return ( return (
<Show when={props.message}> <Show when={toastMessage()}>
<div <div
role="alert" role="alert"
class="fixed bottom-4 right-4 z-50 max-w-md rounded-xl border border-red-200 bg-red-50 px-4 py-3 text-base text-red-700 shadow-lg transition-all duration-400 ease-out" class="fixed bottom-4 right-4 z-50 max-w-md rounded-xl border border-red-200 bg-red-50 px-4 py-3 text-base text-red-700 shadow-lg transition-all duration-400 ease-out"
@@ -67,7 +63,7 @@ export default function Toast(props: ToastProps) {
"translate-y-3 opacity-0 scale-95": !visible(), "translate-y-3 opacity-0 scale-95": !visible(),
}} }}
> >
{props.message} {toastMessage()}
</div> </div>
</Show> </Show>
) )
+31 -4
View File
@@ -32,9 +32,36 @@ export class ApiError extends Error {
export type Plan = Record<string, unknown> export type Plan = Record<string, unknown>
export const PLANS = [ export const PLANS = [
{ id: "free", label: "Free", price: 0, members: "Up to 10", blossom: false, livekit: false }, {
{ id: "basic", label: "Basic", price: 10_000, members: "Up to 100", blossom: true, livekit: true }, id: "free",
{ id: "growth", label: "Growth", price: 50_000, members: "Unlimited", blossom: true, livekit: true }, label: "Free",
subtitle: "Get started, no commitment.",
price: 0,
priceLabel: "0",
memberLabel: "Up to 10 members",
blossom: false,
livekit: false,
},
{
id: "basic",
label: "Basic",
subtitle: "For growing communities.",
price: 10_000,
priceLabel: "10K",
memberLabel: "Up to 100 members",
blossom: true,
livekit: true,
},
{
id: "growth",
label: "Growth",
subtitle: "For large-scale communities.",
price: 50_000,
priceLabel: "50K",
memberLabel: "Unlimited members",
blossom: true,
livekit: true,
},
] as const ] as const
export type PlanId = (typeof PLANS)[number]["id"] export type PlanId = (typeof PLANS)[number]["id"]
@@ -44,7 +71,7 @@ export type Relay = {
tenant: string tenant: string
schema: string schema: string
subdomain: string subdomain: string
plan: string plan: PlanId
status: string status: string
sync_error: string sync_error: string
info_name: string info_name: string
-45
View File
@@ -1,45 +0,0 @@
export const RELAY_PLAN_IDS = ["free", "basic", "growth"] as const
export type RelayPlanId = (typeof RELAY_PLAN_IDS)[number]
export const RELAY_PLANS = [
{
id: "free",
label: "Free",
subtitle: "Get started, no commitment.",
price: 0,
priceLabel: "0",
memberLabel: "Up to 10 members",
blossom: false,
livekit: false,
},
{
id: "basic",
label: "Basic",
subtitle: "For growing communities.",
price: 10_000,
priceLabel: "10K",
memberLabel: "Up to 100 members",
blossom: true,
livekit: true,
},
{
id: "growth",
label: "Growth",
subtitle: "For large-scale communities.",
price: 50_000,
priceLabel: "50K",
memberLabel: "Unlimited members",
blossom: true,
livekit: true,
},
] as const satisfies readonly {
id: RelayPlanId
label: string
subtitle: string
price: number
priceLabel: string
memberLabel: string
blossom: boolean
livekit: boolean
}[]
+1
View File
@@ -22,6 +22,7 @@ export default function Home() {
navigate(`/relays/${relay.id}`) navigate(`/relays/${relay.id}`)
} else { } else {
setDraftRelay(values) setDraftRelay(values)
setShowRelayModal(false)
setShowLoginModal(true) setShowLoginModal(true)
} }
} }
+2 -2
View File
@@ -1,6 +1,6 @@
import { useParams } from "@solidjs/router" import { useParams } from "@solidjs/router"
import { createMemo, createResource, createSignal, Show } from "solid-js" import { createMemo, createResource, createSignal, Show } from "solid-js"
import type { RelayPlanId } from "@/lib/relayPlans" import type { PlanId } from "@/lib/api"
import BackLink from "@/components/BackLink" import BackLink from "@/components/BackLink"
import PageContainer from "@/components/PageContainer" import PageContainer from "@/components/PageContainer"
import RelayDetailCard from "@/components/RelayDetailCard" import RelayDetailCard from "@/components/RelayDetailCard"
@@ -131,7 +131,7 @@ export default function RelayDetail() {
void updateRelay(next, current) void updateRelay(next, current)
} }
async function handleUpdatePlan(plan: RelayPlanId) { async function handleUpdatePlan(plan: PlanId) {
const current = relay() const current = relay()
if (!current) return if (!current) return
+1 -1
View File
@@ -138,7 +138,7 @@ export default function RelayNew() {
<div class="text-sm text-gray-500 mt-1"> <div class="text-sm text-gray-500 mt-1">
{p.price === 0 ? "Free" : `${p.price.toLocaleString()} sats/mo`} {p.price === 0 ? "Free" : `${p.price.toLocaleString()} sats/mo`}
</div> </div>
<div class="text-xs text-gray-500 mt-2">{p.members} members</div> <div class="text-xs text-gray-500 mt-2">{p.memberLabel}</div>
</button> </button>
))} ))}
</div> </div>
+11 -9
View File
@@ -5,6 +5,7 @@ import { PasswordSigner } from "applesauce-signers"
import QrScanner from "qr-scanner" import QrScanner from "qr-scanner"
import QRCode from "qrcode" import QRCode from "qrcode"
import { accountManager, identity, PLATFORM_NAME } from "@/lib/state" import { accountManager, identity, PLATFORM_NAME } from "@/lib/state"
import useMinLoading from "@/components/useMinLoading"
const NIP46_RELAYS = ['wss://bucket.coracle.social', 'wss://ephemeral.snowflare.cc'] const NIP46_RELAYS = ['wss://bucket.coracle.social', 'wss://ephemeral.snowflare.cc']
@@ -46,7 +47,8 @@ type LoginPageProps = LoginProps & Partial<RouteSectionProps<unknown>>
export default function Login(props: LoginPageProps = {}) { export default function Login(props: LoginPageProps = {}) {
const navigate = useNavigate() const navigate = useNavigate()
const [tab, setTab] = createSignal<Tab>(window.nostr ? "nip07" : "nip46") const [tab, setTab] = createSignal<Tab>(window.nostr ? "nip07" : "nip46")
const [loading, setLoading] = createSignal(false) const [rawLoading, setRawLoading] = createSignal(false)
const loading = useMinLoading(() => rawLoading())
const [error, setError] = createSignal("") const [error, setError] = createSignal("")
const [screen, setScreen] = createSignal<Screen>("tabs") const [screen, setScreen] = createSignal<Screen>("tabs")
@@ -72,19 +74,19 @@ export default function Login(props: LoginPageProps = {}) {
async function loginWithNip07() { async function loginWithNip07() {
setError("") setError("")
setLoading(true) setRawLoading(true)
try { try {
await completeLogin(await ExtensionAccount.fromExtension()) await completeLogin(await ExtensionAccount.fromExtension())
} catch (e) { } catch (e) {
setError(e instanceof Error ? e.message : "Failed to login with extension") setError(e instanceof Error ? e.message : "Failed to login with extension")
} finally { } finally {
setLoading(false) setRawLoading(false)
} }
} }
async function startNostrConnect() { async function startNostrConnect() {
setError("") setError("")
setLoading(true) setRawLoading(true)
try { try {
const NostrConnectSigner = await loadNostrConnectSigner() const NostrConnectSigner = await loadNostrConnectSigner()
@@ -110,13 +112,13 @@ export default function Login(props: LoginPageProps = {}) {
} catch (e) { } catch (e) {
setError(e instanceof Error ? e.message : "Failed to connect signer") setError(e instanceof Error ? e.message : "Failed to connect signer")
} finally { } finally {
setLoading(false) setRawLoading(false)
} }
} }
async function loginWithBunker() { async function loginWithBunker() {
setError("") setError("")
setLoading(true) setRawLoading(true)
try { try {
const uri = normalizeBunkerUrl(bunkerUrl()) const uri = normalizeBunkerUrl(bunkerUrl())
const NostrConnectSigner = await loadNostrConnectSigner() const NostrConnectSigner = await loadNostrConnectSigner()
@@ -127,13 +129,13 @@ export default function Login(props: LoginPageProps = {}) {
} catch (e) { } catch (e) {
setError(e instanceof Error ? e.message : "Invalid bunker URL") setError(e instanceof Error ? e.message : "Invalid bunker URL")
} finally { } finally {
setLoading(false) setRawLoading(false)
} }
} }
async function loginWithKeyMaterial() { async function loginWithKeyMaterial() {
setError("") setError("")
setLoading(true) setRawLoading(true)
try { try {
if (ncryptsecValue().trim()) { if (ncryptsecValue().trim()) {
if (!password().trim()) { if (!password().trim()) {
@@ -153,7 +155,7 @@ export default function Login(props: LoginPageProps = {}) {
} catch (e) { } catch (e) {
setError(e instanceof Error ? e.message : "Invalid key") setError(e instanceof Error ? e.message : "Invalid key")
} finally { } finally {
setLoading(false) setRawLoading(false)
} }
} }