-
- {#each PLATFORM_RELAYS as url (url)}
-
- {:else}
-
-
-
-
- {#each primarySpaceUrls as url (url)}
-
- {/each}
-
-
-
-
-
-
- {/each}
-
+
{#if PLATFORM_RELAYS.length > 0}
{/if}
diff --git a/src/app/components/PrimaryNavSpaces.svelte b/src/app/components/PrimaryNavSpaces.svelte
new file mode 100644
index 00000000..55f743af
--- /dev/null
+++ b/src/app/components/PrimaryNavSpaces.svelte
@@ -0,0 +1,45 @@
+
+
+
+
+
+ {#each PLATFORM_RELAYS as url (url)}
+
+ {:else}
+
+
+
+
+ {#each primarySpaceUrls as url (url)}
+
+ {/each}
+
+
+
+
+
+
+ {/each}
+
diff --git a/src/app/util/history.ts b/src/app/util/history.ts
index 430f2703..e7ee6f68 100644
--- a/src/app/util/history.ts
+++ b/src/app/util/history.ts
@@ -8,6 +8,7 @@ export const setupHistory = () =>
if ($page.params.relay) {
lastPageBySpaceUrl.set($page.params.relay, $page.url.pathname)
}
+
if ($page.params.chat) {
lastChatUrl = $page.url.pathname
}
diff --git a/src/app/util/routes.ts b/src/app/util/routes.ts
index deb66d8e..1e987533 100644
--- a/src/app/util/routes.ts
+++ b/src/app/util/routes.ts
@@ -47,7 +47,7 @@ export const makeSpacePath = (url: string, ...extra: (string | undefined)[]) =>
export const goToSpace = async (url: string) => {
const prevPath = lastPageBySpaceUrl.get(encodeRelay(url))
- if (prevPath) {
+ if (prevPath && prevPath !== makeSpacePath(url)) {
goto(prevPath)
} else if (hasNip29(await loadRelay(url))) {
goto(makeSpacePath(url, "recent"))
diff --git a/src/routes/spaces/[relay]/+page.svelte b/src/routes/spaces/[relay]/+page.svelte
index 92ecec2d..b6ea076a 100644
--- a/src/routes/spaces/[relay]/+page.svelte
+++ b/src/routes/spaces/[relay]/+page.svelte
@@ -1,10 +1,7 @@