Show navigation on space landing on mobile

This commit is contained in:
Jon Staab
2026-03-12 16:41:07 -07:00
parent 77294e7f1c
commit 9e74c94871
21 changed files with 193 additions and 283 deletions
-3
View File
@@ -180,7 +180,6 @@ export const allNotifications = derived(
for (const url of getSpaceUrlsFromGroupList($userGroupList)) {
const spacePath = makeSpacePath(url)
const spacePathMobile = spacePath + ":mobile"
const eventsById = eventsByIdByUrl.get(url) || new Map()
const latestEvent = first(sortEventsDesc(eventsById.values()))
@@ -194,7 +193,6 @@ export const allNotifications = derived(
const latestEvent = find(e => e.tags.some(spec(["h", h])), eventsById.values())
if (hasNotification(roomPath, latestEvent)) {
paths.add(spacePathMobile)
paths.add(spacePath)
paths.add(roomPath)
}
@@ -203,7 +201,6 @@ export const allNotifications = derived(
const messagesPath = makeSpaceChatPath(url)
if (hasNotification(messagesPath, first(eventsById.values()))) {
paths.add(spacePathMobile)
paths.add(spacePath)
paths.add(messagesPath)
}
+4 -4
View File
@@ -1,4 +1,5 @@
import type {Page} from "@sveltejs/kit"
import theme from "tailwindcss/defaultTheme"
import {get} from "svelte/store"
import * as nip19 from "nostr-tools/nip19"
import {goto} from "$app/navigation"
@@ -6,7 +7,7 @@ import {page} from "$app/stores"
import {nthEq} from "@welshman/lib"
import type {TrustedEvent} from "@welshman/util"
import {getAddress} from "@welshman/util"
import {tracker, loadRelay} from "@welshman/app"
import {tracker} from "@welshman/app"
import {identity} from "@welshman/lib"
import {
getTagValue,
@@ -23,7 +24,6 @@ import {
decodeRelay,
encodeRelay,
userSpaceUrls,
hasNip29,
DM_KINDS,
ROOM,
} from "@app/core/state"
@@ -49,10 +49,10 @@ export const goToSpace = async (url: string) => {
if (prevPath && prevPath !== makeSpacePath(url)) {
goto(prevPath)
} else if (hasNip29(await loadRelay(url))) {
} else if (window.matchMedia(`(min-width: ${theme.screens.md})`).matches) {
goto(makeSpacePath(url, "recent"))
} else {
goto(makeSpacePath(url, "chat"))
goto(makeSpacePath(url))
}
}