File tree Expand file tree Collapse file tree 3 files changed +14
-4
lines changed
Expand file tree Collapse file tree 3 files changed +14
-4
lines changed Original file line number Diff line number Diff line change 11import type { DragDropEvents } from "@dnd-kit-svelte/svelte" ;
22import type { PaneGroupProps } from "paneforge" ;
3+ import { settings } from "$lib/settings" ;
34
45export type SplitDirection = "up" | "down" | "left" | "right" ;
56
@@ -15,10 +16,12 @@ export type SplitNode = SplitParent | string;
1516type SplitPath = "first" | "second" ;
1617
1718export class SplitManager {
18- public root = $state < SplitNode | null > ( null ) ;
19+ public get root ( ) {
20+ return settings . state . layout ;
21+ }
1922
20- public constructor ( root ? : SplitNode ) {
21- this . root = root ?? null ;
23+ public set root ( value : SplitNode | null ) {
24+ settings . state . layout = value ;
2225 }
2326
2427 public insert ( target : string , newNode : string , data : SplitParent ) {
Original file line number Diff line number Diff line change 11import { RuneStore } from "@tauri-store/svelte" ;
22import type { User } from "./graphql/twitch" ;
3+ import type { SplitNode } from "./managers/split-manager.svelte" ;
34
45export type HighlightType =
56 | "mention"
@@ -69,6 +70,7 @@ interface Settings extends UserSettings {
6970 user : StoredUser | null ;
7071 lastJoined : string | null ;
7172 pinned : string [ ] ;
73+ layout : SplitNode | null ;
7274}
7375
7476export const defaultHighlightTypes : Record < HighlightType , HighlightConfig > = {
@@ -86,6 +88,7 @@ export const defaults: Settings = {
8688 user : null ,
8789 lastJoined : null ,
8890 pinned : [ ] ,
91+ layout : null ,
8992
9093 "appearance.theme" : "" ,
9194 "chat.hideScrollbar" : false ,
Original file line number Diff line number Diff line change 1818 await app .user .fetchEmoteSets ();
1919 }
2020
21- if (settings .state .lastJoined ) {
21+ if (settings .state .layout ) {
22+ app .splits .root = settings .state .layout ;
23+
24+ await goto (" /channels/split" );
25+ } else if (settings .state .lastJoined ) {
2226 await goto (` /channels/${settings .state .lastJoined } ` );
2327 }
2428
You can’t perform that action at this time.
0 commit comments