diff --git a/.changeset/perfect-walls-jog.md b/.changeset/perfect-walls-jog.md new file mode 100644 index 000000000..75f2bb5a1 --- /dev/null +++ b/.changeset/perfect-walls-jog.md @@ -0,0 +1,5 @@ +--- +"nostrudel": patch +--- + +Fix zap button on prism posts diff --git a/src/components/note/note-zap-button.tsx b/src/components/note/note-zap-button.tsx index e137cc61a..6bd0535f2 100644 --- a/src/components/note/note-zap-button.tsx +++ b/src/components/note/note-zap-button.tsx @@ -32,6 +32,7 @@ export default function NoteZapButton({ event, allowComment, showEventPreview, . }; const total = totalZaps(zaps); + const canZap = !!metadata?.allowsNostr || event.tags.some((t) => t[0] === "zap"); return ( <> @@ -43,7 +44,7 @@ export default function NoteZapButton({ event, allowComment, showEventPreview, . colorScheme={hasZapped ? "primary" : undefined} {...props} onClick={onOpen} - isDisabled={!metadata?.allowsNostr} + isDisabled={!canZap} > {readablizeSats(total / 1000)} @@ -54,7 +55,7 @@ export default function NoteZapButton({ event, allowComment, showEventPreview, . title="Zap Note" {...props} onClick={onOpen} - isDisabled={!metadata?.allowsNostr} + isDisabled={!canZap} /> )} diff --git a/src/services/settings/migrations.ts b/src/services/settings/migrations.ts index 97a6880d1..3c7df17c6 100644 --- a/src/services/settings/migrations.ts +++ b/src/services/settings/migrations.ts @@ -76,11 +76,12 @@ export const defaultSettings: AppSettings = { youtubeRedirect: undefined, }; -export function upgradeSettings(settings: { version: number }): AppSettings { +export function upgradeSettings(settings: { version: number }): AppSettings | null { if (isV0(settings)) return { ...defaultSettings, ...settings, version: 3 }; if (isV1(settings)) return { ...defaultSettings, ...settings, version: 3 }; if (isV2(settings)) return { ...defaultSettings, ...settings, version: 3 }; - return settings as AppSettings; + if (isV3(settings)) return settings; + return null; } export function parseAppSettings(event: NostrEvent): AppSettings {