commit e5e0eaab86908f3881375b33aef332e96938e384
parent 160635642df285816e30211ef1fe1a7498e2ffd4
Author: triesap <137732411+triesap@users.noreply.github.com>
Date: Fri, 30 Aug 2024 14:46:32 +0000
Edit nav stores separating previous and title, add test nostr features for metadata and text notes
Diffstat:
17 files changed, 466 insertions(+), 84 deletions(-)
diff --git a/android/app/capacitor.build.gradle b/android/app/capacitor.build.gradle
@@ -14,12 +14,12 @@ dependencies {
implementation project(':capacitor-geolocation')
implementation project(':capacitor-haptics')
implementation project(':capacitor-preferences')
- implementation project(':capacitor-splash-screen')
implementation project(':capacitor-share')
+ implementation project(':capacitor-splash-screen')
implementation project(':capacitor-status-bar')
implementation project(':radroots-capacitor-native-settings')
- implementation project(':radroots-capacitor-sqlite')
implementation project(':radroots-capacitor-secure-storage')
+ implementation project(':radroots-capacitor-sqlite')
implementation project(':radroots-capacitor-wifi')
}
diff --git a/android/capacitor.settings.gradle b/android/capacitor.settings.gradle
@@ -17,23 +17,23 @@ project(':capacitor-haptics').projectDir = new File('../../../node_modules/.pnpm
include ':capacitor-preferences'
project(':capacitor-preferences').projectDir = new File('../../../node_modules/.pnpm/@capacitor+preferences@6.0.2_@capacitor+core@6.1.2/node_modules/@capacitor/preferences/android')
-include ':capacitor-splash-screen'
-project(':capacitor-splash-screen').projectDir = new File('../../../node_modules/.pnpm/@capacitor+splash-screen@6.0.2_@capacitor+core@6.1.2/node_modules/@capacitor/splash-screen/android')
-
include ':capacitor-share'
project(':capacitor-share').projectDir = new File('../../../node_modules/.pnpm/@capacitor+share@6.0.2_@capacitor+core@6.1.2/node_modules/@capacitor/share/android')
+include ':capacitor-splash-screen'
+project(':capacitor-splash-screen').projectDir = new File('../../../node_modules/.pnpm/@capacitor+splash-screen@6.0.2_@capacitor+core@6.1.2/node_modules/@capacitor/splash-screen/android')
+
include ':capacitor-status-bar'
project(':capacitor-status-bar').projectDir = new File('../../../node_modules/.pnpm/@capacitor+status-bar@6.0.1_@capacitor+core@6.1.2/node_modules/@capacitor/status-bar/android')
include ':radroots-capacitor-native-settings'
project(':radroots-capacitor-native-settings').projectDir = new File('../../../packages/capacitor-native-settings/android')
-include ':radroots-capacitor-sqlite'
-project(':radroots-capacitor-sqlite').projectDir = new File('../../../packages/capacitor-sqlite/android')
-
include ':radroots-capacitor-secure-storage'
project(':radroots-capacitor-secure-storage').projectDir = new File('../../../packages/capacitor-secure-storage/android')
+include ':radroots-capacitor-sqlite'
+project(':radroots-capacitor-sqlite').projectDir = new File('../../../packages/capacitor-sqlite/android')
+
include ':radroots-capacitor-wifi'
project(':radroots-capacitor-wifi').projectDir = new File('../../../packages/capacitor-wifi/android')
diff --git a/ios/App/Podfile b/ios/App/Podfile
@@ -16,12 +16,12 @@ def capacitor_pods
pod 'CapacitorGeolocation', :path => '../../../../node_modules/.pnpm/@capacitor+geolocation@6.0.1_@capacitor+core@6.1.2/node_modules/@capacitor/geolocation'
pod 'CapacitorHaptics', :path => '../../../../node_modules/.pnpm/@capacitor+haptics@6.0.1_@capacitor+core@6.1.2/node_modules/@capacitor/haptics'
pod 'CapacitorPreferences', :path => '../../../../node_modules/.pnpm/@capacitor+preferences@6.0.2_@capacitor+core@6.1.2/node_modules/@capacitor/preferences'
- pod 'CapacitorSplashScreen', :path => '../../../../node_modules/.pnpm/@capacitor+splash-screen@6.0.2_@capacitor+core@6.1.2/node_modules/@capacitor/splash-screen'
pod 'CapacitorShare', :path => '../../../../node_modules/.pnpm/@capacitor+share@6.0.2_@capacitor+core@6.1.2/node_modules/@capacitor/share'
+ pod 'CapacitorSplashScreen', :path => '../../../../node_modules/.pnpm/@capacitor+splash-screen@6.0.2_@capacitor+core@6.1.2/node_modules/@capacitor/splash-screen'
pod 'CapacitorStatusBar', :path => '../../../../node_modules/.pnpm/@capacitor+status-bar@6.0.1_@capacitor+core@6.1.2/node_modules/@capacitor/status-bar'
pod 'RadrootsCapacitorNativeSettings', :path => '../../../../packages/capacitor-native-settings'
- pod 'RadrootsCapacitorSqlite', :path => '../../../../packages/capacitor-sqlite'
pod 'RadrootsCapacitorSecureStorage', :path => '../../../../packages/capacitor-secure-storage'
+ pod 'RadrootsCapacitorSqlite', :path => '../../../../packages/capacitor-sqlite'
pod 'RadrootsCapacitorWifi', :path => '../../../../packages/capacitor-wifi'
end
diff --git a/ios/App/Podfile.lock b/ios/App/Podfile.lock
@@ -108,6 +108,6 @@ SPEC CHECKSUMS:
SQLCipher: 77fbe633cd84db04b07876dd50766b4924b57d61
ZIPFoundation: b8c29ea7ae353b309bc810586181fd073cb3312c
-PODFILE CHECKSUM: 34db81164faae86cd39fa914520554892f82ec41
+PODFILE CHECKSUM: c6c1e7d552d32beb42585f968d80f8b142e3fef4
COCOAPODS: 1.15.2
diff --git a/package.json b/package.json
@@ -40,15 +40,17 @@
"@capacitor/dialog": "^6.0.0",
"@capacitor/geolocation": "^6.0.0",
"@capacitor/haptics": "^6.0.0",
+ "@capacitor/ios": "^6.0.0",
"@capacitor/preferences": "^6.0.0",
- "@capacitor/splash-screen": "^6.0.0",
"@capacitor/share": "^6.0.0",
+ "@capacitor/splash-screen": "^6.0.0",
"@capacitor/status-bar": "^6.0.0",
- "@capacitor/ios": "^6.0.0",
"@ionic/pwa-elements": "^3.3.0",
+ "@nostr-dev-kit/ndk": "^2.7.1",
+ "@nostr-dev-kit/ndk-cache-dexie": "^2.3.1",
"@radroots/capacitor-native-settings": "workspace:*",
- "@radroots/capacitor-sqlite": "workspace:*",
"@radroots/capacitor-secure-storage": "workspace:*",
+ "@radroots/capacitor-sqlite": "workspace:*",
"@radroots/capacitor-wifi": "workspace:*",
"@radroots/client": "workspace:*",
"@radroots/jeep-sqlite": "workspace:*",
diff --git a/src/lib/client.ts b/src/lib/client.ts
@@ -2,4 +2,4 @@ import { ClientCapacitor } from "@radroots/client";
import { NostrTools } from "../../../../packages/utils";
export const cl = new ClientCapacitor();
-export const nt = new NostrTools();
-\ No newline at end of file
+export const nt = new NostrTools();
diff --git a/src/lib/components/layout-view.svelte b/src/lib/components/layout-view.svelte
@@ -1,5 +1,5 @@
<script lang="ts">
- import { app_layout, app_nav, app_nav_blur, app_tabs_blur, app_tabs_visible } from "$lib/stores";
+ import { app_layout, app_nav_blur, app_nav_visible, app_tabs_blur, app_tabs_visible } from "$lib/stores";
import { type AppLayoutKey, type PropChildren } from "@radroots/svelte-lib";
const styles: Record<AppLayoutKey, string> = {
@@ -11,7 +11,7 @@
let el: HTMLElement | null;
- let classes_nav = $derived($app_nav ? `pt-h_nav_${$app_layout}` : `${styles[$app_layout]}`)
+ let classes_nav = $derived($app_nav_visible ? `pt-h_nav_${$app_layout}` : `${styles[$app_layout]}`)
let classes_tabs = $derived($app_tabs_visible ? `pb-h_tabs_${$app_layout}` : ``)
const scrollChange = (): void => {
diff --git a/src/lib/components/nav.svelte b/src/lib/components/nav.svelte
@@ -1,6 +1,11 @@
<script lang="ts">
import { goto } from "$app/navigation";
- import { app_layout, app_nav, app_nav_blur } from "$lib/stores";
+ import {
+ app_layout,
+ app_nav_blur,
+ app_nav_prev,
+ app_nav_title,
+ } from "$lib/stores";
import {
encode_qp,
fill as Fill,
@@ -16,10 +21,10 @@
let title_label = $state(``);
- app_nav.subscribe((app_nav) => {
- if (!app_nav) return;
- if (app_nav.prev && app_nav.prev.length) {
- const previous = app_nav.prev[app_nav.prev.length - 1];
+ app_nav_prev.subscribe((app_nav_prev) => {
+ console.log(JSON.stringify(app_nav_prev, null, 4), `app_nav_prev`);
+ if (app_nav_prev.length) {
+ const previous = app_nav_prev[app_nav_prev.length - 1];
if (previous) {
previous_route = previous.route;
if (previous.label) previous_label = previous.label;
@@ -27,15 +32,17 @@
previous_param = encode_qp(previous.params);
}
}
+ });
- if (app_nav.title) {
- title_label = app_nav.title.label;
- }
+ app_nav_title.subscribe((app_nav_title) => {
+ if (!app_nav_title) return;
+ title_label = app_nav_title.label;
});
const handle_previous = async (): Promise<void> => {
try {
const url = `${previous_route || `/`}${previous_param || ``}`;
+ app_nav_prev.set($app_nav_prev.slice(0, -1));
await goto(url);
} catch (e) {
console.log(`(error) handle_previous `, e);
diff --git a/src/lib/stores.ts b/src/lib/stores.ts
@@ -1,7 +1,7 @@
import type { AppLayoutKey } from "@radroots/svelte-lib";
import { type ColorMode, type ThemeKey } from "@radroots/theme";
import { writable } from "svelte/store";
-import type { NavParam } from "./types";
+import type { NavParamPrev, NavParamTitle } from "./types";
export const app_thc = writable<ColorMode>(`light`);
export const app_thm = writable<ThemeKey>(`os`);
@@ -21,4 +21,6 @@ export const app_nostr_key = writable<string>(``);
export const app_pwa_polyfills = writable<boolean>(false);
export const app_sqlite = writable<boolean>(false);
-export const app_nav = writable<NavParam | false>(false);
+export const app_nav_visible = writable<boolean>(false);
+export const app_nav_prev = writable<NavParamPrev>([]);
+export const app_nav_title = writable<NavParamTitle | false>(false);
diff --git a/src/lib/types.ts b/src/lib/types.ts
@@ -1,16 +1,6 @@
import type { NavigationPreviousParam } from "@radroots/svelte-lib";
-export type NavParam = {
- prev?: NavigationPreviousParam[];
- title?: {
- label: string
- };
-}
-
-/*
-let previous_route = $state(``);
-let previous_param = $state(``);
-let previous_label = $state(``);
-
-let title_label = $state(``);
-*/
-\ No newline at end of file
+export type NavParamPrev = NavigationPreviousParam[];
+export type NavParamTitle = {
+ label: string;
+};
diff --git a/src/routes/(app)/+layout.svelte b/src/routes/(app)/+layout.svelte
@@ -2,14 +2,14 @@
import { goto } from "$app/navigation";
import Nav from "$lib/components/nav.svelte";
import Tabs from "$lib/components/tabs.svelte";
- import { app_layout, app_nav, app_tab_active, app_tabs_visible } from "$lib/stores";
+ import { app_layout, app_nav_prev, app_nav_title, app_nav_visible, app_tab_active, app_tabs_visible } from "$lib/stores";
import { type PropChildren } from "@radroots/svelte-lib";
let { children }: PropChildren = $props();
</script>
{@render children()}
-{#if $app_nav !== false }
+{#if $app_nav_visible }
<Nav />
{/if}
{#if $app_tabs_visible}
@@ -28,29 +28,36 @@
{
icon: `key`,
callback: async (tab_i) => {
- app_tab_active.set(tab_i);
+ //
},
},
{
icon: `network`,
callback: async (tab_i) => {
app_tab_active.set(tab_i);
+ app_nav_prev.set([
+ ...$app_nav_prev,
+ {
+ label: `Home`,
+ route: `/`
+ }
+ ]);
+ app_nav_title.set({
+ label: `Nostr`,
+ });
+ await goto("/nostr");
},
},
{
icon: `bell-simple`,
callback: async (tab_i) => {
app_tab_active.set(tab_i);
- app_nav.set({
- prev: [
- {
- label: `Home`,
- route: `/`
- }
- ],
- title: {
- label: `Settings`,
- },
+ $app_nav_prev.push( {
+ label: `Home`,
+ route: `/`
+ });
+ app_nav_title.set({
+ label: `Settings`,
});
await goto("/settings");
},
diff --git a/src/routes/(app)/+page.svelte b/src/routes/(app)/+page.svelte
@@ -1,35 +1,38 @@
<script lang="ts">
import { goto } from "$app/navigation";
import { cl } from "$lib/client";
- import { _cf } from "$lib/conf";
- import { app_nav, app_tab_active, app_tabs_visible } from "$lib/stores";
+ import {
+ app_nav_prev,
+ app_nav_title,
+ app_nav_visible,
+ app_tab_active,
+ app_tabs_visible,
+ } from "$lib/stores";
+ import { NDKKind } from "@nostr-dev-kit/ndk";
import { ndk, ndk_event, ndk_user, t } from "@radroots/svelte-lib";
$effect(() => {
- app_nav.set(false);
+ app_nav_visible.set(false);
app_tabs_visible.set(true);
app_tab_active.set(0);
});
- const save_nostr_metadata = async (): Promise<void> => {
+ const nostr_note_pub = async (): Promise<void> => {
try {
- const metadata = {
- name: `radroots!`,
- display_name: _cf.root_symbol,
- };
+ const content = `hello from radroots`;
const ev = await ndk_event({
$ndk,
$ndk_user,
basis: {
- kind: 0,
- content: JSON.stringify(metadata),
+ kind: NDKKind.Text,
+ content: JSON.stringify(content),
},
});
-
+ console.log(JSON.stringify(ev, null, 4), `ev`);
if (ev) await ev.publish();
- cl.dialog.alert(`Published metadata ${JSON.stringify(metadata)}`);
+ cl.dialog.alert(`Published content ${JSON.stringify(content)}`);
} catch (e) {
- console.log(`(error) `, e);
+ console.log(`(error) nostr_note_pub `, e);
}
};
</script>
@@ -46,16 +49,12 @@
<button
class={`button-simple`}
onclick={async () => {
- app_nav.set({
- prev: [
- {
- label: `Home`,
- route: `/`,
- },
- ],
- title: {
- label: `Models`,
- },
+ $app_nav_prev.push({
+ label: `Home`,
+ route: `/`,
+ });
+ app_nav_title.set({
+ label: `Models`,
});
await goto(`/models/location-gcs`);
}}
@@ -65,9 +64,9 @@
<button
class={`button-simple`}
onclick={async () => {
- await save_nostr_metadata();
+ await nostr_note_pub();
}}
>
- {"publish metadata"}
+ {"publish test note"}
</button>
</div>
diff --git a/src/routes/(app)/nostr/+page.svelte b/src/routes/(app)/nostr/+page.svelte
@@ -0,0 +1,78 @@
+<script lang="ts">
+ import { goto } from "$app/navigation";
+ import LayoutTrellis from "$lib/components/layout-trellis.svelte";
+ import LayoutView from "$lib/components/layout-view.svelte";
+ import { app_nav_prev, app_nav_title, app_nav_visible } from "$lib/stores";
+ import { trellis as Trellis } from "@radroots/svelte-lib";
+
+ $effect(() => {
+ app_nav_visible.set(true);
+ });
+</script>
+
+<LayoutView>
+ <LayoutTrellis>
+ <Trellis
+ basis={{
+ args: {
+ layer: 1,
+ title: {
+ value: `Nostr`,
+ },
+ list: [
+ {
+ hide_active: true,
+ touch: {
+ label: {
+ left: [
+ {
+ value: `View Profile`,
+ },
+ ],
+ },
+ callback: async () => {
+ app_nav_prev.set([
+ ...$app_nav_prev,
+ {
+ label: `Nostr`,
+ route: `/nostr`,
+ },
+ ]);
+ app_nav_title.set({
+ label: `Profile`,
+ });
+ await goto(`/nostr/profile`);
+ },
+ },
+ },
+ {
+ hide_active: true,
+ touch: {
+ label: {
+ left: [
+ {
+ value: `View Notes`,
+ },
+ ],
+ },
+ callback: async () => {
+ app_nav_prev.set([
+ ...$app_nav_prev,
+ {
+ label: `Nostr`,
+ route: `/nostr`,
+ },
+ ]);
+ app_nav_title.set({
+ label: `Notes`,
+ });
+ await goto(`/nostr/notes`);
+ },
+ },
+ },
+ ],
+ },
+ }}
+ />
+ </LayoutTrellis>
+</LayoutView>
diff --git a/src/routes/(app)/nostr/notes/+page.svelte b/src/routes/(app)/nostr/notes/+page.svelte
@@ -0,0 +1,121 @@
+<script lang="ts">
+ import { cl } from "$lib/client";
+ import LayoutTrellis from "$lib/components/layout-trellis.svelte";
+ import LayoutView from "$lib/components/layout-view.svelte";
+ import { app_nav_visible, app_nostr_key } from "$lib/stores";
+ import {
+ NDKEvent,
+ NDKKind,
+ type NDKFilter,
+ type NDKSubscriptionOptions,
+ } from "@nostr-dev-kit/ndk";
+ import {
+ locale,
+ ndk,
+ time_fmt_nostr_event,
+ trellis as Trellis,
+ } from "@radroots/svelte-lib";
+
+ $effect(() => {
+ app_nav_visible.set(true);
+ });
+
+ const ndk_filter: NDKFilter = {
+ kinds: [NDKKind.Text],
+ authors: [$app_nostr_key],
+ };
+
+ const ndk_opts: NDKSubscriptionOptions = {
+ closeOnEose: false,
+ };
+
+ let ndk_events = $state<NDKEvent[]>([]);
+
+ const ndk_sub = $ndk.subscribe(ndk_filter, ndk_opts);
+
+ ndk_sub.on("event", (event) => {
+ ndk_events.push(event);
+ ndk_events.sort(
+ (a, b) =>
+ parseInt(cl.nostr.ev.first_tag_value(b, "published_at")) -
+ parseInt(cl.nostr.ev.first_tag_value(a, "published_at")),
+ );
+ ndk_events = ndk_events;
+ });
+</script>
+
+<LayoutView>
+ <LayoutTrellis>
+ {#if ndk_events.length}
+ {#each ndk_events as ev, ev_i (ev.id)}
+ <Trellis
+ basis={{
+ args: {
+ layer: 1,
+ title:
+ ev_i === 0
+ ? {
+ value: `Notes`,
+ }
+ : undefined,
+ list: [
+ {
+ hide_active: true,
+ touch: {
+ label: {
+ left: [
+ {
+ value: ev.content,
+ },
+ ],
+ },
+ callback: async () => {},
+ },
+ },
+ {
+ hide_active: true,
+ touch: {
+ label: {
+ left: [
+ {
+ value: `Published: ${time_fmt_nostr_event($locale, ev.created_at)}`,
+ },
+ ],
+ },
+ callback: async () => {},
+ },
+ },
+ ],
+ },
+ }}
+ />
+ {/each}
+ {:else}
+ <Trellis
+ basis={{
+ args: {
+ layer: 1,
+ title: {
+ value: `Notes`,
+ },
+ list: [
+ {
+ hide_active: true,
+ touch: {
+ label: {
+ left: [
+ {
+ value: `No text notes`,
+ },
+ ],
+ },
+ callback: async () => {},
+ },
+ },
+ ],
+ },
+ }}
+ />
+ {/if}
+ </LayoutTrellis>
+</LayoutView>
diff --git a/src/routes/(app)/nostr/profile/+page.svelte b/src/routes/(app)/nostr/profile/+page.svelte
@@ -0,0 +1,109 @@
+<script lang="ts">
+ import { goto } from "$app/navigation";
+ import { cl } from "$lib/client";
+ import LayoutTrellis from "$lib/components/layout-trellis.svelte";
+ import LayoutView from "$lib/components/layout-view.svelte";
+ import {
+ app_nav_prev,
+ app_nav_title,
+ app_nav_visible,
+ app_nostr_key,
+ } from "$lib/stores";
+ import {
+ NDKEvent,
+ NDKKind,
+ type NDKFilter,
+ type NDKSubscriptionOptions,
+ } from "@nostr-dev-kit/ndk";
+ import { ndk, trellis as Trellis } from "@radroots/svelte-lib";
+
+ $effect(() => {
+ app_nav_visible.set(true);
+ });
+
+ const ndk_filter: NDKFilter = {
+ kinds: [NDKKind.Metadata],
+ authors: [$app_nostr_key],
+ };
+
+ const ndk_opts: NDKSubscriptionOptions = {
+ closeOnEose: false,
+ };
+
+ let ndk_events = $state<NDKEvent[]>([]);
+
+ const ndk_sub = $ndk.subscribe(ndk_filter, ndk_opts);
+
+ ndk_sub.on("event", (event) => {
+ ndk_events.push(event);
+ ndk_events.sort(
+ (a, b) =>
+ parseInt(cl.nostr.ev.first_tag_value(b, "published_at")) -
+ parseInt(cl.nostr.ev.first_tag_value(a, "published_at")),
+ );
+ ndk_events = ndk_events;
+ });
+</script>
+
+<LayoutView>
+ <LayoutTrellis>
+ <Trellis
+ basis={{
+ args: {
+ layer: 1,
+ title: {
+ value: `Nostr Profile`,
+ },
+ list: ndk_events.length
+ ? Object.entries(JSON.parse(ndk_events[0].content)).map(
+ ([entry_key, entry_val]) => ({
+ hide_active: true,
+ touch: {
+ label: {
+ left: [
+ {
+ value: `${entry_key}: ${entry_val}`,
+ classes: `capitalize`,
+ },
+ ],
+ },
+ callback: async () => {},
+ },
+ }),
+ )
+ : [
+ {
+ touch: {
+ label: {
+ left: [
+ {
+ value: `Add Profile`,
+ },
+ ],
+ },
+ end: {
+ icon: {
+ key: `caret-right`,
+ },
+ },
+ callback: async () => {
+ app_nav_prev.set([
+ ...$app_nav_prev,
+ {
+ label: `Profile`,
+ route: `/nostr/profile`,
+ },
+ ]);
+ app_nav_title.set({
+ label: `Add Profile`,
+ });
+ await goto(`/nostr/profile/edit`);
+ },
+ },
+ },
+ ],
+ },
+ }}
+ />
+ </LayoutTrellis>
+</LayoutView>
diff --git a/src/routes/(app)/nostr/profile/edit/+page.svelte b/src/routes/(app)/nostr/profile/edit/+page.svelte
@@ -0,0 +1,68 @@
+<script lang="ts">
+ import { goto } from "$app/navigation";
+ import { cl } from "$lib/client";
+ import { app_nav_prev } from "$lib/stores";
+ import { NDKKind } from "@nostr-dev-kit/ndk";
+ import { ndk, ndk_event, ndk_user } from "@radroots/svelte-lib";
+
+ $effect(() => {
+ (async () => {
+ try {
+ const profile_name = await cl.dialog.prompt({
+ title: `Profile Name`,
+ message: `What is your profile name.`,
+ input_placeholder: `Enter profile name`,
+ });
+ if (profile_name === false) {
+ await goto(`/`);
+ return;
+ }
+
+ const display_name = await cl.dialog.prompt({
+ title: `Display Name`,
+ message: `What is your display name.`,
+ input_placeholder: `Enter display name`,
+ });
+ if (display_name === false) {
+ await goto(`/`);
+ return;
+ }
+
+ await nostr_metadata_pub({
+ profile_name,
+ display_name,
+ });
+ } catch (e) {}
+ })();
+ });
+
+ const nostr_metadata_pub = async (opts: {
+ profile_name: string;
+ display_name: string;
+ }): Promise<void> => {
+ try {
+ const { profile_name: name, display_name } = opts;
+ const content = {
+ name,
+ display_name,
+ };
+ const ev = await ndk_event({
+ $ndk,
+ $ndk_user,
+ basis: {
+ kind: NDKKind.Metadata,
+ content: JSON.stringify(content),
+ },
+ });
+ console.log(JSON.stringify(ev, null, 4), `ev`);
+ if (ev) await ev.publish();
+ cl.dialog.alert(`Published content ${JSON.stringify(content)}`);
+ app_nav_prev.set([]);
+ await goto(`/`);
+ } catch (e) {
+ console.log(`(error) nostr_metadata_pub `, e);
+ }
+ };
+</script>
+
+<div></div>
diff --git a/src/routes/(app)/settings/+page.svelte b/src/routes/(app)/settings/+page.svelte
@@ -3,13 +3,14 @@
import LayoutTrellis from "$lib/components/layout-trellis.svelte";
import LayoutView from "$lib/components/layout-view.svelte";
import { _cf } from "$lib/conf";
- import { app_tabs_visible, app_thc } from "$lib/stores";
+ import { app_nav_visible, app_tabs_visible, app_thc } from "$lib/stores";
import {
toggle_color_mode,
trellis as Trellis,
} from "@radroots/svelte-lib";
$effect(() => {
+ app_nav_visible.set(true);
app_tabs_visible.set(false);
});
</script>
@@ -199,7 +200,7 @@
label: {
left: [
{
- value: `Open Radroots Homepage`,
+ value: `Radroots Homepage (Open)`,
},
],
},
@@ -214,7 +215,7 @@
label: {
left: [
{
- value: `Share Radroots Homepage`,
+ value: `Radroots Homepage (Share)`,
},
],
},