diff --git a/src/app/util/notifications.ts b/src/app/util/notifications.ts index 278202bf..3f296982 100644 --- a/src/app/util/notifications.ts +++ b/src/app/util/notifications.ts @@ -173,9 +173,7 @@ export const notifications = derived( if (hasNip29($relaysByUrl.get(url))) { for (const h of getSpaceRoomsFromGroupSelections(url, $userGroupSelections)) { const roomPath = makeRoomPath(url, h) - const latestEvent = allMessages.find( - e => $getUrlsForEvent(e.id).includes(url) && e.tags.find(spec(["h", h])), - ) + const latestEvent = messages.find(e => e.tags.some(spec(["h", h]))) if (hasNotification(roomPath, latestEvent)) { paths.add(spacePathMobile) diff --git a/src/app/util/storage.ts b/src/app/util/storage.ts index 29f58311..f3fa39b9 100644 --- a/src/app/util/storage.ts +++ b/src/app/util/storage.ts @@ -1,11 +1,6 @@ import {prop, call, on, throttle, fromPairs, batch} from "@welshman/lib" import {throttled, freshness} from "@welshman/store" import { - ALERT_ANDROID, - ALERT_EMAIL, - ALERT_IOS, - ALERT_STATUS, - ALERT_WEB, APP_DATA, BLOSSOM_SERVERS, DIRECT_MESSAGE_FILE, @@ -50,6 +45,7 @@ import { wrapManager, } from "@welshman/app" import {Collection} from "@lib/storage" +import {isMobile} from "@lib/html" const syncEvents = async () => { const collection = new Collection({table: "events", getId: prop("id")}) @@ -73,7 +69,6 @@ const syncEvents = async () => { APP_DATA, ROOMS, ] - const alertKinds = [ALERT_STATUS, ALERT_EMAIL, ALERT_WEB, ALERT_IOS, ALERT_ANDROID] const spaceKinds = [RELAY_ADD_MEMBER, RELAY_REMOVE_MEMBER, RELAY_MEMBERS, RELAY_JOIN, RELAY_LEAVE] const roomKinds = [ ROOM_META, @@ -88,10 +83,9 @@ const syncEvents = async () => { const rankEvent = (event: TrustedEvent) => { if (metaKinds.includes(event.kind)) return 9 - if (alertKinds.includes(event.kind)) return 8 - if (spaceKinds.includes(event.kind)) return 7 - if (roomKinds.includes(event.kind)) return 6 - if (contentKinds.includes(event.kind)) return 5 + if (spaceKinds.includes(event.kind)) return 8 + if (roomKinds.includes(event.kind)) return 7 + if (!isMobile && contentKinds.includes(event.kind)) return 6 return 0 } @@ -240,17 +234,21 @@ const syncWrapManager = async () => { } export const syncDataStores = async () => { - const unsubscribers = await Promise.all([ + const promises = [ syncEvents(), syncTracker(), syncRelays(), - syncRelayStats(), syncHandles(), syncZappers(), - syncFreshness(), syncPlaintext(), syncWrapManager(), - ]) + ] + + if (!isMobile) { + promises.push(syncFreshness(), syncRelayStats()) + } + + const unsubscribers = await Promise.all(promises) return () => unsubscribers.forEach(call) } diff --git a/src/lib/components/Dialog.svelte b/src/lib/components/Dialog.svelte index e0626201..4c17ce6a 100644 --- a/src/lib/components/Dialog.svelte +++ b/src/lib/components/Dialog.svelte @@ -1,4 +1,5 @@ @@ -23,7 +28,7 @@ transition:fade={{duration: 300}} onclick={onClose}> -
+
{@render children?.()}