File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
packages/common-ui/src/stores Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ export const useConfigStore = () => {
1717 config : {
1818 darkMode : false ,
1919 likesConfetti : false ,
20+ sessionTimeLimit : 5 , // Default 5 minutes
2021 } as UserConfig ,
2122 } ) ,
2223
@@ -40,6 +41,14 @@ export const useConfigStore = () => {
4041 } ) ;
4142 } ,
4243
44+ async updateSessionTimeLimit ( sessionTimeLimit : number ) {
45+ this . config . sessionTimeLimit = sessionTimeLimit ;
46+ const user = await getCurrentUser ( ) ;
47+ await user . setConfig ( {
48+ sessionTimeLimit,
49+ } ) ;
50+ } ,
51+
4352 async hydrate ( ) {
4453 const user = await getCurrentUser ( ) ;
4554 const cfg = await user . getConfig ( ) ;
@@ -53,6 +62,7 @@ export const useConfigStore = () => {
5362 this . config = {
5463 darkMode : false ,
5564 likesConfetti : false ,
65+ sessionTimeLimit : 5 ,
5666 } ;
5767 } ,
5868 } ,
You can’t perform that action at this time.
0 commit comments