diff --git a/src/app/components/IntentHandler.svelte b/src/app/components/IntentHandler.svelte new file mode 100644 index 00000000..c598ae35 --- /dev/null +++ b/src/app/components/IntentHandler.svelte @@ -0,0 +1,273 @@ + + +{#if hasSettings} + event.preventDefault()}> +
+ +
+ Apply Customization? + A link is requesting to customize your app. +
+
+ + + {#if errors.length === 0} +

This link will apply the following changes:

+
    + {#if t} +
  • Set theme to "{t}"
  • + {/if} + {#if relays.length > 0} +
  • Add {relays.length} relay{relays.length > 1 ? "s" : ""} to your settings
  • + {/if} + {#if blossoms.length > 0} +
  • Add {blossoms.length} blossom server{blossoms.length > 1 ? "s" : ""}
  • + {/if} + {#if follows.length > 0} +
  • Follow {follows.length} person{follows.length > 1 ? "s" : ""}
  • + {/if} + {#if joins.length > 0} +
  • Join {joins.length} communit{joins.length > 1 ? "ies" : "y"}
  • + {/if} + {#if hasProfile} +
  • Update your profile metadata
  • + {/if} + {#if hasShare} +
  • Open a new post dialog in a specific room
  • + {/if} +
+ {:else} +

Some actions failed. You can abort or continue with successful actions only.

+
    + {#each errors as error} +
  • {error}
  • + {/each} +
+ {/if} +
+ + + {#if errors.length === 0} + + + {:else} + + + {/if} + +
+
+{/if} diff --git a/src/app/components/ThreadCreate.svelte b/src/app/components/ThreadCreate.svelte index 45b69f0d..350516f2 100644 --- a/src/app/components/ThreadCreate.svelte +++ b/src/app/components/ThreadCreate.svelte @@ -29,11 +29,14 @@ type Props = { url: string h?: string + initialContent?: string } - const {url, h}: Props = $props() + const {url, h, initialContent = ""}: Props = $props() + const draftKey = new DraftKey(`thread:${url}:${h ?? ""}`) - const initialValues = draftKey.get() + const initialValues = initialContent ? {content: initialContent} : draftKey.get() + const shouldProtect = canEnforceNip70(url) const uploading = writable(false) @@ -81,8 +84,8 @@ history.back() } - let title = $state(initialValues?.title ?? "") - let content = $state(initialValues?.content ?? "") + let title: string = $state(initialValues?.title ?? "") + let content: string | object = $state(initialValues?.content ?? "") const onChange = (json: object) => { content = json @@ -98,7 +101,7 @@ }) $effect(() => { - draftKey.update({title, content}) + draftKey.set({title, content}) }) diff --git a/src/app/core/state.ts b/src/app/core/state.ts index 195516fb..78aba6fb 100644 --- a/src/app/core/state.ts +++ b/src/app/core/state.ts @@ -259,8 +259,9 @@ export const pubkeyLink = (pubkey: string, relays = Router.get().FromPubkeys([pu export const bootstrapPubkeys = derived(userFollowList, $userFollowList => { const appPubkeys = DEFAULT_PUBKEYS.split(",") const userPubkeys = shuffle(getPubkeyTagValues(getListTags($userFollowList))) + const mergedPubkeys = userPubkeys.length > 5 ? userPubkeys : [...userPubkeys, ...appPubkeys] - return userPubkeys.length > 5 ? userPubkeys : [...userPubkeys, ...appPubkeys] + return uniq(mergedPubkeys) }) export const deriveEvent = makeDeriveEvent({ diff --git a/src/lib/components/Dialog.svelte b/src/lib/components/Dialog.svelte index 261cce23..4a9a58f3 100644 --- a/src/lib/components/Dialog.svelte +++ b/src/lib/components/Dialog.svelte @@ -6,7 +6,6 @@ import Close from "@assets/icons/close.svg?dataurl" import Icon from "@lib/components/Icon.svelte" import Button from "@lib/components/Button.svelte" - import {clearModals} from "@app/util/modal" type Props = { onClose?: any @@ -56,7 +55,7 @@
{#if !noEscape} - {/if} diff --git a/src/lib/components/Page.svelte b/src/lib/components/Page.svelte index 8ee859e6..b0879ad7 100644 --- a/src/lib/components/Page.svelte +++ b/src/lib/components/Page.svelte @@ -9,6 +9,6 @@
+ class="scroll-container relative flex-grow flex min-h-0 flex-col min-w-0 overflow-y-auto overflow-x-hidden ml-sai mb-sai mt-sai mr-sai bg-base-200 md:ml-0 md:mb-0 {props.class}"> {@render props.children?.()}
diff --git a/src/routes/intent/+page.svelte b/src/routes/intent/+page.svelte new file mode 100644 index 00000000..ef30915c --- /dev/null +++ b/src/routes/intent/+page.svelte @@ -0,0 +1,16 @@ + + + goto("/home")} /> diff --git a/src/routes/join/+page.svelte b/src/routes/join/+page.svelte index 1083d874..abf101ed 100644 --- a/src/routes/join/+page.svelte +++ b/src/routes/join/+page.svelte @@ -13,4 +13,4 @@ } - + goto("/home")} /> diff --git a/src/routes/people/+page.svelte b/src/routes/people/+page.svelte index 7d9937b6..d532dda1 100644 --- a/src/routes/people/+page.svelte +++ b/src/routes/people/+page.svelte @@ -17,7 +17,7 @@ const search = debounce(200, (term: string) => { if (term) { - pubkeys = $profileSearch.searchValues(term) + pubkeys = Array.from(new Set($profileSearch.searchValues(term))) } else { pubkeys = $bootstrapPubkeys }