Populate feeds with default accounts

This commit is contained in:
Jon Staab
2024-10-11 15:29:54 -07:00
parent e21063f247
commit f5461d551e
6 changed files with 30 additions and 17 deletions
+2 -3
View File
@@ -1,5 +1,6 @@
<script lang="ts">
import {goto} from "$app/navigation"
import {pubkey} from '@welshman/app'
import Field from "@lib/components/Field.svelte"
import Button from "@lib/components/Button.svelte"
import Icon from "@lib/components/Icon.svelte"
@@ -10,9 +11,7 @@
const back = () => history.back()
const onSubmit = async () => {
goto(makeChatPath(pubkeys))
}
const onSubmit = () => goto(makeChatPath([...pubkeys, $pubkey!]))
let pubkeys: string[] = []
</script>
+2 -2
View File
@@ -17,9 +17,9 @@ export const pushModal = (
) => {
const id = randomId()
// TODO: fix memory leak here by listening to history somehow
modals.set(id, {component, props, options})
goto("#" + id)
setTimeout(() => goto("#" + id))
return id
}
+5 -3
View File
@@ -1,15 +1,17 @@
<script lang="ts">
import cx from "classnames"
import {goto} from '$app/navigation'
export let href
export let external = false
const go = () => goto(href)
</script>
<a
{href}
{...$$props}
on:click|stopPropagation
class={cx($$props.class, "cursor-pointer")}
class="cursor-pointer {$$props.class}"
on:click|preventDefault|stopPropagation={go}
rel={external ? "noopener noreferer" : ""}
target={external ? "_blank" : ""}>
<slot />
+5 -6
View File
@@ -113,15 +113,14 @@
{/if}
</div>
<div slot="action">
{#if $missingInboxes.length > 0}
{@const plural = $missingInboxes.length > 0}
{#if remove($pubkey, $missingInboxes).length > 0}
{@const count = remove($pubkey, $missingInboxes).length}
{@const label = count > 0 ? 'inboxes are' : 'inbox is'}
<div
class="row-2 badge badge-error badge-lg tooltip tooltip-left cursor-pointer"
data-tip="{$missingInboxes.length} {plural
? 'inboxes are'
: 'inbox is'} not configured.">
data-tip="{count} {label} not configured.">
<Icon icon="danger" />
{$missingInboxes.length}
{count}
</div>
{/if}
</div>
+10
View File
@@ -13,6 +13,8 @@
import type {TrustedEvent} from "@welshman/util"
import {deriveEvents} from "@welshman/store"
import {repository, userFollows, load} from "@welshman/app"
import Link from "@lib/components/Link.svelte"
import Icon from "@lib/components/Icon.svelte"
import Spinner from "@lib/components/Spinner.svelte"
import NoteCard from "@app/components/NoteCard.svelte"
import Content from "@app/components/Content.svelte"
@@ -85,6 +87,14 @@
<Content {event} />
</div>
</NoteCard>
{:else}
<div class="py-20 max-w-sm col-4 items-center m-auto text-center">
<p>No activity found! Try following a few more people.</p>
<Link class="btn btn-primary" href="/home/people">
<Icon icon="user-heart" />
Browse Profiles
</Link>
</div>
{/each}
</div>
{/await}
+6 -3
View File
@@ -1,14 +1,17 @@
<script lang="ts">
import {onMount} from "svelte"
import {createScroller} from "@lib/html"
import Icon from "@lib/components/Icon.svelte"
import {shuffle} from "@welshman/lib"
import {uniq, shuffle} from "@welshman/lib"
import {getPubkeyTagValues, getListTags} from "@welshman/util"
import {profileSearch, userFollows} from "@welshman/app"
import Icon from "@lib/components/Icon.svelte"
import PageHeader from "@lib/components/PageHeader.svelte"
import PeopleItem from "@app/components/PeopleItem.svelte"
const defaultPubkeys = shuffle(getPubkeyTagValues(getListTags($userFollows)))
const defaultPubkeys = uniq([
...shuffle(getPubkeyTagValues(getListTags($userFollows))),
...import.meta.env.VITE_DEFAULT_PUBKEYS.split(','),
])
let term = ""
let limit = 10