diff --git a/apps/desktop2/src/routes/auth/new/$account.backup.tsx b/apps/desktop2/src/routes/auth/$account.backup.tsx similarity index 97% rename from apps/desktop2/src/routes/auth/new/$account.backup.tsx rename to apps/desktop2/src/routes/auth/$account.backup.tsx index a01c74c05..982aeb3c6 100644 --- a/apps/desktop2/src/routes/auth/new/$account.backup.tsx +++ b/apps/desktop2/src/routes/auth/$account.backup.tsx @@ -9,7 +9,7 @@ import { useState } from "react"; import { useTranslation } from "react-i18next"; import { toast } from "sonner"; -export const Route = createFileRoute("/auth/new/$account/backup")({ +export const Route = createFileRoute("/auth/$account/backup")({ component: Screen, }); @@ -33,8 +33,7 @@ function Screen() { } return navigate({ - to: "/auth/$account/settings", - params: { account }, + to: "/auth/settings", }); } diff --git a/apps/desktop2/src/routes/auth/new/profile.tsx b/apps/desktop2/src/routes/auth/new/profile.tsx index 6601c4163..09fdc7ad3 100644 --- a/apps/desktop2/src/routes/auth/new/profile.tsx +++ b/apps/desktop2/src/routes/auth/new/profile.tsx @@ -45,7 +45,7 @@ function Screen() { if (eventId) { navigate({ - to: "/auth/new/$account/backup", + to: "/auth/$account/backup", params: { account: account.npub }, replace: true, }); diff --git a/apps/desktop2/src/routes/auth/privkey.lazy.tsx b/apps/desktop2/src/routes/auth/privkey.lazy.tsx index 15daa529c..91b5481e8 100644 --- a/apps/desktop2/src/routes/auth/privkey.lazy.tsx +++ b/apps/desktop2/src/routes/auth/privkey.lazy.tsx @@ -28,8 +28,7 @@ function Screen() { if (npub) { navigate({ - to: "/auth/$account/settings", - params: { account: npub }, + to: "/auth/settings", replace: true, }); } diff --git a/apps/desktop2/src/routes/auth/remote.lazy.tsx b/apps/desktop2/src/routes/auth/remote.lazy.tsx index 7b344c2b9..50636dd1e 100644 --- a/apps/desktop2/src/routes/auth/remote.lazy.tsx +++ b/apps/desktop2/src/routes/auth/remote.lazy.tsx @@ -27,8 +27,7 @@ function Screen() { if (npub) { navigate({ - to: "/auth/$account/settings", - params: { account: npub }, + to: "/auth/settings", replace: true, }); } diff --git a/apps/desktop2/src/routes/auth/$account.settings.tsx b/apps/desktop2/src/routes/auth/settings.tsx similarity index 97% rename from apps/desktop2/src/routes/auth/$account.settings.tsx rename to apps/desktop2/src/routes/auth/settings.tsx index c8b67089d..d0f300502 100644 --- a/apps/desktop2/src/routes/auth/$account.settings.tsx +++ b/apps/desktop2/src/routes/auth/settings.tsx @@ -8,7 +8,7 @@ import { useState } from "react"; import { useTranslation } from "react-i18next"; import { toast } from "sonner"; -export const Route = createFileRoute("/auth/$account/settings")({ +export const Route = createFileRoute("/auth/settings")({ beforeLoad: async () => { const settings = await NostrQuery.getSettings(); return { settings }; @@ -18,14 +18,14 @@ export const Route = createFileRoute("/auth/$account/settings")({ }); function Screen() { - const navigate = Route.useNavigate(); - const { account } = Route.useParams(); const { settings } = Route.useRouteContext(); const { t } = useTranslation(); const [newSettings, setNewSettings] = useState(settings); const [loading, setLoading] = useState(false); + const navigate = Route.useNavigate(); + const toggleNofitication = async () => { await requestPermission(); setNewSettings((prev) => ({ @@ -72,8 +72,7 @@ function Screen() { if (eventId) { return navigate({ - to: "/$account/home", - params: { account }, + to: "/", replace: true, }); } diff --git a/packages/system/src/query.ts b/packages/system/src/query.ts index c3c083100..23684308b 100644 --- a/packages/system/src/query.ts +++ b/packages/system/src/query.ts @@ -236,31 +236,28 @@ export class NostrQuery { } static async getColumns() { + const systemPath = "resources/system_columns.json"; + const resourcePath = await resolveResource(systemPath); + const resourceFile = await readTextFile(resourcePath); + const systemColumns: LumeColumn[] = JSON.parse(resourceFile); const query = await commands.getNstore(NSTORE_KEYS.columns); if (query.status === "ok") { const columns: LumeColumn[] = query.data ? JSON.parse(query.data) : []; if (columns.length < 1) { - const systemPath = "resources/system_columns.json"; - const resourcePath = await resolveResource(systemPath); - const resourceFile = await readTextFile(resourcePath); - const systemColumns: LumeColumn[] = JSON.parse(resourceFile); - return systemColumns; } return columns; } else { - return []; + return systemColumns; } } static async setColumns(columns: LumeColumn[]) { - const query = await commands.setNstore( - NSTORE_KEYS.columns, - JSON.stringify(columns), - ); + const content = JSON.stringify(columns); + const query = await commands.setNstore(NSTORE_KEYS.columns, content); if (query.status === "ok") { return query.data;