feat: store sidebar expanded state in settings (#69)
Add an expandSidebar setting to remember if the sidebar is expanded or collapsed. This allows the user to refresh or open a post in a new tab and keep the same sidebar state (rather than it always being expanded). One possible quirk is that if a user has it collapsed in one tab, but expanded in another, it will remember which ever state was set last (most recently). However, changing the state in one tab will not impact another (until a refresh occurs). Fix #68
This commit is contained in:
1 parent
4cc9867e90
commit
644003bfef
2 files changed
+19
-18
No files matched your search
@@ -18,6 +18,7 @@ interface Settings {
|
||||
feed: 'All' | 'Subscribed' | 'Local'
|
||||
}
|
||||
fullWidthLayout: boolean
|
||||
expandSidebar: boolean
|
||||
}
|
||||
|
||||
const defaultSettings: Settings = {
|
||||
@@ -36,6 +37,7 @@ const defaultSettings: Settings = {
|
||||
feed: 'Local',
|
||||
},
|
||||
fullWidthLayout: false,
|
||||
expandSidebar: true,
|
||||
}
|
||||
|
||||
export const userSettings = writable(defaultSettings)
|
||||
|
||||
Reference in new issue
Block a user