fix(style): working dark mode persistence
This commit is contained in:
		
							parent
							
								
									765c010700
								
							
						
					
					
						commit
						3ae872847b
					
				| @ -1,13 +1,9 @@ | |||||||
| import { useStorage, usePreferredDark } from '@vueuse/core'; | import { useStorage } from '@vueuse/core'; | ||||||
| import { defineStore } from 'pinia'; | import { defineStore } from 'pinia'; | ||||||
| import type { Ref } from 'vue'; | import type { Ref } from 'vue'; | ||||||
| 
 | 
 | ||||||
| export const useStyleStore = defineStore('style', { | export const useStyleStore = defineStore('style', { | ||||||
|   state: () => { |   state: () => ({ | ||||||
|     const isDark = usePreferredDark(); |     isDarkTheme: useStorage('useDarkTheme', false) as Ref<boolean>, | ||||||
| 
 |   }), | ||||||
|     return { |  | ||||||
|       isDarkTheme: useStorage('useDarkTheme', isDark) as Ref<boolean>, |  | ||||||
|     }; |  | ||||||
|   }, |  | ||||||
| }); | }); | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user