mirror of
https://github.com/coracle-social/flotilla.git
synced 2025-12-10 02:47:06 +00:00
Disable zaps on ios
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
import ChannelMessageEmojiButton from "@app/components/ChannelMessageEmojiButton.svelte"
|
||||
import ChannelMessageMenuButton from "@app/components/ChannelMessageMenuButton.svelte"
|
||||
import ChannelMessageMenuMobile from "@app/components/ChannelMessageMenuMobile.svelte"
|
||||
import {colors} from "@app/state"
|
||||
import {colors, ENABLE_ZAPS} from "@app/state"
|
||||
import {publishDelete, publishReaction} from "@app/commands"
|
||||
import {pushModal} from "@app/modal"
|
||||
|
||||
@@ -95,7 +95,9 @@
|
||||
<button
|
||||
class="join absolute right-1 top-1 border border-solid border-neutral text-xs opacity-0 transition-all"
|
||||
class:group-hover:opacity-100={!isMobile}>
|
||||
<ChannelMessageZapButton {url} {event} />
|
||||
{#if ENABLE_ZAPS}
|
||||
<ChannelMessageZapButton {url} {event} />
|
||||
{/if}
|
||||
<ChannelMessageEmojiButton {url} {event} />
|
||||
{#if replyTo}
|
||||
<Button class="btn join-item btn-xs" onclick={reply}>
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
import ZapButton from "@app/components/ZapButton.svelte"
|
||||
import EmojiButton from "@lib/components/EmojiButton.svelte"
|
||||
import EventMenu from "@app/components/EventMenu.svelte"
|
||||
import {ENABLE_ZAPS} from "@app/state"
|
||||
import {publishReaction} from "@app/commands"
|
||||
|
||||
type Props = {
|
||||
@@ -32,7 +33,7 @@
|
||||
</script>
|
||||
|
||||
<Button class="join rounded-full">
|
||||
{#if !hideZap}
|
||||
{#if ENABLE_ZAPS && !hideZap}
|
||||
<ZapButton {url} {event} class="btn join-item btn-neutral btn-xs">
|
||||
<Icon icon="bolt" size={4} />
|
||||
</ZapButton>
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
import RoomCreate from "@app/components/RoomCreate.svelte"
|
||||
import MenuSpaceRoomItem from "@app/components/MenuSpaceRoomItem.svelte"
|
||||
import {
|
||||
ENABLE_ZAPS,
|
||||
userRoomsByUrl,
|
||||
hasMembershipUrl,
|
||||
memberships,
|
||||
@@ -131,12 +132,14 @@
|
||||
<SecondaryNavItem {replaceState} href={makeSpacePath(url)}>
|
||||
<Icon icon="home-smile" /> Home
|
||||
</SecondaryNavItem>
|
||||
<SecondaryNavItem
|
||||
{replaceState}
|
||||
href={goalsPath}
|
||||
notification={$notifications.has(goalsPath)}>
|
||||
<Icon icon="star-fall-minimalistic-2" /> Goals
|
||||
</SecondaryNavItem>
|
||||
{#if ENABLE_ZAPS}
|
||||
<SecondaryNavItem
|
||||
{replaceState}
|
||||
href={goalsPath}
|
||||
notification={$notifications.has(goalsPath)}>
|
||||
<Icon icon="star-fall-minimalistic-2" /> Goals
|
||||
</SecondaryNavItem>
|
||||
{/if}
|
||||
<SecondaryNavItem
|
||||
{replaceState}
|
||||
href={threadsPath}
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
import Icon from "@lib/components/Icon.svelte"
|
||||
import Reaction from "@app/components/Reaction.svelte"
|
||||
import EventReportDetails from "@app/components/EventReportDetails.svelte"
|
||||
import {REACTION_KINDS} from "@app/state"
|
||||
import {pushModal} from "@app/modal"
|
||||
|
||||
interface Props {
|
||||
@@ -94,7 +95,7 @@
|
||||
load({
|
||||
relays: [url],
|
||||
signal: controller.signal,
|
||||
filters: getReplyFilters([event], {kinds: [REACTION, REPORT, DELETE, ZAP_RESPONSE]}),
|
||||
filters: getReplyFilters([event], {kinds: [REPORT, DELETE, ...REACTION_KINDS]}),
|
||||
onEvent: batch(300, (events: TrustedEvent[]) => {
|
||||
load({
|
||||
relays: [url],
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import twColors from "tailwindcss/colors"
|
||||
import {Capacitor} from "@capacitor/core"
|
||||
import {get, derived} from "svelte/store"
|
||||
import * as nip19 from "nostr-tools/nip19"
|
||||
import {
|
||||
@@ -98,6 +99,10 @@ export const ROOM = "h"
|
||||
|
||||
export const PROTECTED = ["-"]
|
||||
|
||||
export const ENABLE_ZAPS = Capacitor.getPlatform() != "ios"
|
||||
|
||||
export const REACTION_KINDS = ENABLE_ZAPS ? [REACTION, ZAP_RESPONSE] : [REACTION]
|
||||
|
||||
export const NOTIFIER_PUBKEY = import.meta.env.VITE_NOTIFIER_PUBKEY
|
||||
|
||||
export const NOTIFIER_RELAY = import.meta.env.VITE_NOTIFIER_RELAY
|
||||
@@ -132,8 +137,6 @@ export const DUFFLEPUD_URL = "https://dufflepud.onrender.com"
|
||||
|
||||
export const IMGPROXY_URL = "https://imgproxy.coracle.social"
|
||||
|
||||
export const REACTION_KINDS = [REACTION, ZAP_RESPONSE]
|
||||
|
||||
export const NIP46_PERMS =
|
||||
"nip44_encrypt,nip44_decrypt," +
|
||||
[CLIENT_AUTH, AUTH_JOIN, MESSAGE, THREAD, COMMENT, ROOMS, WRAP, REACTION, ZAP_REQUEST]
|
||||
|
||||
@@ -12,8 +12,6 @@
|
||||
makeRoomMeta,
|
||||
MESSAGE,
|
||||
DELETE,
|
||||
REACTION,
|
||||
ZAP_RESPONSE,
|
||||
ROOM_ADD_USER,
|
||||
ROOM_REMOVE_USER,
|
||||
} from "@welshman/util"
|
||||
@@ -38,6 +36,7 @@
|
||||
deriveUserMembershipStatus,
|
||||
deriveChannel,
|
||||
MembershipStatus,
|
||||
REACTION_KINDS,
|
||||
} from "@app/state"
|
||||
import {setChecked, checked} from "@app/notifications"
|
||||
import {addRoomMembership, removeRoomMembership, prependParent} from "@app/commands"
|
||||
@@ -228,7 +227,7 @@
|
||||
relays: [url],
|
||||
feedFilters: [filter],
|
||||
subscriptionFilters: [
|
||||
{kinds: [DELETE, REACTION, ZAP_RESPONSE, MESSAGE], "#h": [room], since: now()},
|
||||
{kinds: [DELETE, MESSAGE, ...REACTION_KINDS], "#h": [room], since: now()},
|
||||
],
|
||||
initialEvents: getEventsForUrl(url, [{...filter, limit: 20}]),
|
||||
onExhausted: () => {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
import {page} from "$app/stores"
|
||||
import {now, last, formatTimestampAsDate} from "@welshman/lib"
|
||||
import type {TrustedEvent} from "@welshman/util"
|
||||
import {REACTION, ZAP_RESPONSE, DELETE, EVENT_TIME, getTagValue} from "@welshman/util"
|
||||
import {DELETE, EVENT_TIME, getTagValue} from "@welshman/util"
|
||||
import {fly} from "@lib/transition"
|
||||
import Icon from "@lib/components/Icon.svelte"
|
||||
import Button from "@lib/components/Button.svelte"
|
||||
@@ -17,7 +17,7 @@
|
||||
import CalendarEventItem from "@app/components/CalendarEventItem.svelte"
|
||||
import CalendarEventCreate from "@app/components/CalendarEventCreate.svelte"
|
||||
import {pushModal} from "@app/modal"
|
||||
import {getEventsForUrl, decodeRelay} from "@app/state"
|
||||
import {getEventsForUrl, decodeRelay, REACTION_KINDS} from "@app/state"
|
||||
import {makeCalendarFeed} from "@app/requests"
|
||||
import {setChecked} from "@app/notifications"
|
||||
|
||||
@@ -93,9 +93,7 @@
|
||||
|
||||
onMount(() => {
|
||||
const feedFilters = [{kinds: [EVENT_TIME]}]
|
||||
const subscriptionFilters = [
|
||||
{kinds: [DELETE, REACTION, ZAP_RESPONSE, EVENT_TIME], since: now()},
|
||||
]
|
||||
const subscriptionFilters = [{kinds: [DELETE, EVENT_TIME, ...REACTION_KINDS], since: now()}]
|
||||
|
||||
;({events, cleanup} = makeCalendarFeed({
|
||||
element: element!,
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
import type {Readable} from "svelte/store"
|
||||
import {now, formatTimestampAsDate} from "@welshman/lib"
|
||||
import type {TrustedEvent, EventContent} from "@welshman/util"
|
||||
import {makeEvent, MESSAGE, DELETE, REACTION, ZAP_RESPONSE} from "@welshman/util"
|
||||
import {makeEvent, MESSAGE, DELETE} from "@welshman/util"
|
||||
import {pubkey, publishThunk} from "@welshman/app"
|
||||
import {slide, fade, fly} from "@lib/transition"
|
||||
import Icon from "@lib/components/Icon.svelte"
|
||||
@@ -21,7 +21,7 @@
|
||||
import {userSettingValues, decodeRelay, getEventsForUrl} from "@app/state"
|
||||
import {setChecked, checked} from "@app/notifications"
|
||||
import {prependParent} from "@app/commands"
|
||||
import {PROTECTED} from "@app/state"
|
||||
import {PROTECTED, REACTION_KINDS} from "@app/state"
|
||||
import {makeFeed} from "@app/requests"
|
||||
import {popKey} from "@app/implicit"
|
||||
|
||||
@@ -174,7 +174,7 @@
|
||||
element: element!,
|
||||
relays: [url],
|
||||
feedFilters: [filter],
|
||||
subscriptionFilters: [{kinds: [DELETE, REACTION, ZAP_RESPONSE, MESSAGE], since: now()}],
|
||||
subscriptionFilters: [{kinds: [DELETE, MESSAGE, ...REACTION_KINDS], since: now()}],
|
||||
initialEvents: getEventsForUrl(url, [{...filter, limit: 20}]),
|
||||
onExhausted: () => {
|
||||
loadingEvents = false
|
||||
|
||||
@@ -3,15 +3,7 @@
|
||||
import {page} from "$app/stores"
|
||||
import {sortBy, max, nthEq} from "@welshman/lib"
|
||||
import type {TrustedEvent} from "@welshman/util"
|
||||
import {
|
||||
ZAP_GOAL,
|
||||
REACTION,
|
||||
ZAP_RESPONSE,
|
||||
DELETE,
|
||||
COMMENT,
|
||||
getListTags,
|
||||
getPubkeyTagValues,
|
||||
} from "@welshman/util"
|
||||
import {ZAP_GOAL, DELETE, COMMENT, getListTags, getPubkeyTagValues} from "@welshman/util"
|
||||
import {userMutes} from "@welshman/app"
|
||||
import {fly} from "@lib/transition"
|
||||
import Icon from "@lib/components/Icon.svelte"
|
||||
@@ -22,7 +14,7 @@
|
||||
import MenuSpaceButton from "@app/components/MenuSpaceButton.svelte"
|
||||
import GoalItem from "@app/components/GoalItem.svelte"
|
||||
import GoalCreate from "@app/components/GoalCreate.svelte"
|
||||
import {decodeRelay, getEventsForUrl} from "@app/state"
|
||||
import {decodeRelay, getEventsForUrl, REACTION_KINDS} from "@app/state"
|
||||
import {setChecked} from "@app/notifications"
|
||||
import {makeFeed} from "@app/requests"
|
||||
import {pushModal} from "@app/modal"
|
||||
@@ -57,7 +49,7 @@
|
||||
relays: [url],
|
||||
feedFilters: [{kinds: [ZAP_GOAL, COMMENT]}],
|
||||
subscriptionFilters: [
|
||||
{kinds: [ZAP_GOAL, REACTION, ZAP_RESPONSE, DELETE]},
|
||||
{kinds: [ZAP_GOAL, DELETE, ...REACTION_KINDS]},
|
||||
{kinds: [COMMENT], "#K": [String(ZAP_GOAL)]},
|
||||
],
|
||||
initialEvents: getEventsForUrl(url, [{kinds: [ZAP_GOAL, COMMENT], limit: 10}]),
|
||||
|
||||
@@ -3,15 +3,7 @@
|
||||
import {page} from "$app/stores"
|
||||
import {sortBy, max, nthEq} from "@welshman/lib"
|
||||
import type {TrustedEvent} from "@welshman/util"
|
||||
import {
|
||||
THREAD,
|
||||
REACTION,
|
||||
ZAP_RESPONSE,
|
||||
DELETE,
|
||||
COMMENT,
|
||||
getListTags,
|
||||
getPubkeyTagValues,
|
||||
} from "@welshman/util"
|
||||
import {THREAD, DELETE, COMMENT, getListTags, getPubkeyTagValues} from "@welshman/util"
|
||||
import {userMutes} from "@welshman/app"
|
||||
import {fly} from "@lib/transition"
|
||||
import Icon from "@lib/components/Icon.svelte"
|
||||
@@ -24,6 +16,7 @@
|
||||
import ThreadCreate from "@app/components/ThreadCreate.svelte"
|
||||
import {decodeRelay, getEventsForUrl} from "@app/state"
|
||||
import {setChecked} from "@app/notifications"
|
||||
import {REACTION_KINDS} from "@app/state"
|
||||
import {makeFeed} from "@app/requests"
|
||||
import {pushModal} from "@app/modal"
|
||||
|
||||
@@ -57,7 +50,7 @@
|
||||
relays: [url],
|
||||
feedFilters: [{kinds: [THREAD, COMMENT]}],
|
||||
subscriptionFilters: [
|
||||
{kinds: [THREAD, REACTION, ZAP_RESPONSE, DELETE]},
|
||||
{kinds: [THREAD, DELETE, ...REACTION_KINDS]},
|
||||
{kinds: [COMMENT], "#K": [String(THREAD)]},
|
||||
],
|
||||
initialEvents: getEventsForUrl(url, [{kinds: [THREAD, COMMENT], limit: 10}]),
|
||||
|
||||
Reference in New Issue
Block a user