diff --git a/src/lib/commands/built-in/join.ts b/src/lib/commands/built-in/join.ts
index a464e90c..f97cf287 100644
--- a/src/lib/commands/built-in/join.ts
+++ b/src/lib/commands/built-in/join.ts
@@ -1,4 +1,5 @@
import { goto } from "$app/navigation";
+import { resolve } from "$app/paths";
import { app } from "$lib/app.svelte";
import { ApiError } from "$lib/errors/api-error";
import { CommandError } from "$lib/errors/command-error";
@@ -32,6 +33,10 @@ export default defineCommand({
}
}
- await goto(`/channels/${args[0]}`);
+ await goto(
+ resolve("/(main)/channels/[username]", {
+ username: args[0],
+ }),
+ );
},
});
diff --git a/src/lib/commands/built-in/leave.ts b/src/lib/commands/built-in/leave.ts
index 4d92841b..0b023a9e 100644
--- a/src/lib/commands/built-in/leave.ts
+++ b/src/lib/commands/built-in/leave.ts
@@ -1,4 +1,5 @@
import { goto } from "$app/navigation";
+import { resolve } from "$app/paths";
import { defineCommand } from "../util";
export default defineCommand({
@@ -7,6 +8,6 @@ export default defineCommand({
description: "Leave the current channel",
async exec(_, channel) {
await channel.leave();
- await goto("/");
+ await goto(resolve("/"));
},
});
diff --git a/src/lib/components/JoinDialog.svelte b/src/lib/components/JoinDialog.svelte
index fb67814a..00969ddf 100644
--- a/src/lib/components/JoinDialog.svelte
+++ b/src/lib/components/JoinDialog.svelte
@@ -12,6 +12,7 @@
import * as Dialog from "./ui/dialog";
import * as Field from "./ui/field";
import { Input } from "./ui/input";
+ import { resolve } from "$app/paths";
interface Props {
children: Snippet;
@@ -69,7 +70,11 @@
app.channels.set(channel.id, channel);
}
- await goto(`/channels/${channel.user.username}`);
+ await goto(
+ resolve("/(main)/channels/[username]", {
+ username: channel.user.username,
+ }),
+ );
open = false;
reset();
diff --git a/src/lib/components/Sidebar.svelte b/src/lib/components/Sidebar.svelte
index bfc9f4a5..f2890861 100644
--- a/src/lib/components/Sidebar.svelte
+++ b/src/lib/components/Sidebar.svelte
@@ -1,4 +1,5 @@
@@ -122,7 +123,9 @@
{#if app.user}