@@ -16,6 +16,7 @@ import { ref, set } from 'vue'
1616const initialUserConfig = loadState < UserConfig > ( 'files' , 'config' , {
1717 crop_image_previews : true ,
1818 default_view : 'files' ,
19+ folder_tree : true ,
1920 grid_view : false ,
2021 show_files_extensions : true ,
2122 show_hidden : false ,
@@ -36,7 +37,7 @@ export const useUserConfigStore = defineStore('userconfig', () => {
3637 * @param key The config key
3738 * @param value The new value
3839 */
39- function onUpdate ( key : string , value : boolean ) : void {
40+ function onUpdate < Key extends string > ( key : Key , value : UserConfig [ Key ] ) : void {
4041 set ( userConfig . value , key , value )
4142 }
4243
@@ -46,7 +47,7 @@ export const useUserConfigStore = defineStore('userconfig', () => {
4647 * @param key The config key
4748 * @param value The new value
4849 */
49- async function update ( key : string , value : boolean ) : Promise < void > {
50+ async function update < Key extends string > ( key : Key , value : UserConfig [ Key ] ) : Promise < void > {
5051 // only update if a user is logged in (not the case for public shares)
5152 if ( getCurrentUser ( ) !== null ) {
5253 await axios . put ( generateUrl ( '/apps/files/api/v1/config/{key}' , { key } ) , {
0 commit comments