Skip to content

Commit c4a8d9d

Browse files
committed
don't save single splits
1 parent 9c153ad commit c4a8d9d

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

src/lib/components/split/SplitHeader.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@
2020
if (app.splits.root === id) {
2121
if (channel) {
2222
await goto(`/channels/${channel.user.username}`);
23-
app.splits.root = null;
2423
} else {
2524
await goto("/");
2625
}
2726
27+
app.splits.root = null;
2828
return;
2929
}
3030

src/lib/settings.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,4 +117,14 @@ export const defaults: Settings = {
117117
"advanced.logs.level": "info",
118118
};
119119

120-
export const settings = new RuneStore<Settings>("settings", defaults);
120+
export const settings = new RuneStore<Settings>("settings", defaults, {
121+
hooks: {
122+
beforeBackendSync(state) {
123+
if (typeof state.layout === "string") {
124+
state.layout = null;
125+
}
126+
127+
return state;
128+
},
129+
},
130+
});

src/routes/(main)/+page.svelte

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818
await app.user.fetchEmoteSets();
1919
}
2020
21-
// Only navigate to split view if there's more than one split
22-
if (settings.state.layout && typeof settings.state.layout !== "string") {
21+
if (settings.state.layout) {
2322
app.splits.root = settings.state.layout;
2423
2524
await goto("/channels/split");

0 commit comments

Comments
 (0)