mirror of
https://github.com/coracle-social/coracle.git
synced 2024-09-30 00:41:12 +00:00
Allow dismissing zap prompt
This commit is contained in:
parent
2a32f31aba
commit
2e3df2838d
@ -1,6 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import {onMount} from "svelte"
|
import {onMount} from "svelte"
|
||||||
import {writable, hash} from "@welshman/lib"
|
import {seconds} from "hurdak"
|
||||||
|
import {writable, now, hash} from "@welshman/lib"
|
||||||
import {createScroller, synced} from "src/util/misc"
|
import {createScroller, synced} from "src/util/misc"
|
||||||
import {fly, fade} from "src/util/transition"
|
import {fly, fade} from "src/util/transition"
|
||||||
import Anchor from "src/partials/Anchor.svelte"
|
import Anchor from "src/partials/Anchor.svelte"
|
||||||
@ -28,6 +29,8 @@
|
|||||||
|
|
||||||
const splits = [["zap", $env.PLATFORM_PUBKEY, "", "1"]]
|
const splits = [["zap", $env.PLATFORM_PUBKEY, "", "1"]]
|
||||||
|
|
||||||
|
const promptDismissed = synced("feed/promptDismissed", 0)
|
||||||
|
|
||||||
const shouldHideReplies = showControls ? synced("Feed.shouldHideReplies", false) : writable(false)
|
const shouldHideReplies = showControls ? synced("Feed.shouldHideReplies", false) : writable(false)
|
||||||
|
|
||||||
const reload = async () => {
|
const reload = async () => {
|
||||||
@ -103,12 +106,19 @@
|
|||||||
{anchor}
|
{anchor}
|
||||||
{note} />
|
{note} />
|
||||||
</div>
|
</div>
|
||||||
{#if i > 20 && parseInt(hash(note.id)) % 100 === 0}
|
{#if i > 20 && parseInt(hash(note.id)) % 100 === 0 && $promptDismissed < now() - seconds(7, "day")}
|
||||||
<Card class="flex items-center justify-between">
|
<Card class="group flex items-center justify-between">
|
||||||
<p class="text-xl">Enjoying Coracle?</p>
|
<p class="text-xl">Enjoying Coracle?</p>
|
||||||
|
<div class="flex gap-2">
|
||||||
|
<Anchor
|
||||||
|
class="text-neutral-400 opacity-0 transition-all group-hover:opacity-100"
|
||||||
|
on:click={() => promptDismissed.set(now())}>
|
||||||
|
Dismiss
|
||||||
|
</Anchor>
|
||||||
<Anchor modal button accent href={router.at("zap").qp({splits}).toString()}>
|
<Anchor modal button accent href={router.at("zap").qp({splits}).toString()}>
|
||||||
Zap the developer
|
Zap the developer
|
||||||
</Anchor>
|
</Anchor>
|
||||||
|
</div>
|
||||||
</Card>
|
</Card>
|
||||||
{/if}
|
{/if}
|
||||||
{/each}
|
{/each}
|
||||||
|
@ -82,7 +82,7 @@
|
|||||||
{#if muted}
|
{#if muted}
|
||||||
<p class="mb-1 py-24 text-center text-neutral-600">
|
<p class="mb-1 py-24 text-center text-neutral-600">
|
||||||
You have hidden this note.
|
You have hidden this note.
|
||||||
<Anchor class="underline" on:click={unmute}>Show</Anchor>
|
<Anchor class="underline" stopPropagation on:click={unmute}>Show</Anchor>
|
||||||
</p>
|
</p>
|
||||||
{:else}
|
{:else}
|
||||||
{#if !isGroup}
|
{#if !isGroup}
|
||||||
|
@ -690,9 +690,7 @@ export const updateSingleton = async (kind: number, modifyTags: ModifyTags) => {
|
|||||||
|
|
||||||
// If we don't have a recent version loaded, re-fetch to avoid dropping updates
|
// If we don't have a recent version loaded, re-fetch to avoid dropping updates
|
||||||
if ((event?.created_at || 0) < now() - seconds(5, "minute")) {
|
if ((event?.created_at || 0) < now() - seconds(5, "minute")) {
|
||||||
console.log("loading")
|
|
||||||
const loadedEvent = await loadOne({relays: hints.User().getUrls(), filters})
|
const loadedEvent = await loadOne({relays: hints.User().getUrls(), filters})
|
||||||
console.log("loaded", loadedEvent)
|
|
||||||
|
|
||||||
if ((loadedEvent?.created_at || 0) > (event?.created_at || 0)) {
|
if ((loadedEvent?.created_at || 0) > (event?.created_at || 0)) {
|
||||||
event = loadedEvent
|
event = loadedEvent
|
||||||
@ -714,15 +712,12 @@ export const updateSingleton = async (kind: number, modifyTags: ModifyTags) => {
|
|||||||
} else {
|
} else {
|
||||||
const singleton = makeSingleton({kind})
|
const singleton = makeSingleton({kind})
|
||||||
const publicTags = modifyTags(singleton.publicTags)
|
const publicTags = modifyTags(singleton.publicTags)
|
||||||
|
|
||||||
encryptable = createSingleton({...singleton, publicTags})
|
encryptable = createSingleton({...singleton, publicTags})
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(1)
|
|
||||||
|
|
||||||
const template = await encryptable.reconcile(encrypt)
|
const template = await encryptable.reconcile(encrypt)
|
||||||
|
|
||||||
console.log(2, template)
|
|
||||||
|
|
||||||
await createAndPublish({...template, content, relays})
|
await createAndPublish({...template, content, relays})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user