Update to new version of welshman, including new thunks and wrap manager

This commit is contained in:
Jon Staab
2025-10-17 10:19:21 -07:00
parent e0099141aa
commit 6ca74c21bf
21 changed files with 205 additions and 315 deletions
+3 -14
View File
@@ -90,6 +90,7 @@ import {
waitForThunkError,
getPubkeyRelays,
userBlossomServers,
shouldUnwrap,
} from "@welshman/app"
import {compressFile} from "@src/lib/html"
import type {SettingsValues, Alert} from "@app/core/state"
@@ -103,8 +104,6 @@ import {
DEFAULT_BLOSSOM_SERVERS,
userRoomsByUrl,
userSettingsValues,
canDecrypt,
ensureUnwrapped,
userInboxRelays,
getMembershipUrls,
} from "@app/core/state"
@@ -593,8 +592,8 @@ export const createAlert = async (params: CreateAlertParams): Promise<CreateAler
}
export const createDmAlert = async () => {
if (!get(canDecrypt)) {
enableGiftWraps()
if (!shouldUnwrap.get()) {
shouldUnwrap.set(true)
}
return createAlert({
@@ -658,16 +657,6 @@ export const payInvoice = async (invoice: string) => {
}
}
// Gift Wraps
export const enableGiftWraps = () => {
canDecrypt.set(true)
for (const event of repository.query([{kinds: [WRAP]}])) {
ensureUnwrapped(event)
}
}
// File upload
export const normalizeBlossomUrl = (url: string) => normalizeUrl(url.replace(/^ws/, "http"))