File tree Expand file tree Collapse file tree
components/general/workspace_selector Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6565 }
6666 : undefined ;
6767
68- await init_or_update_workspace (
69- workspace_root_path . data ?. path ,
70- { path , recent_filenode_path }
71- );
68+ await init_or_update_workspace (workspace_root_path . data , {
69+ path ,
70+ recent_filenode_path ,
71+ } );
7272 }}
7373 class ="
7474 {workspace_root_path.data?.path == path.path && 'bg-base-100'}
121121 onclick ={async () => {
122122 const path = await show_folder_picker ();
123123
124+ // Update the prevous workspace
124125 const recent_filenode_path = opened_filenode .data
125126 ? {
126127 path: opened_filenode .data .path ,
127128 document_top_tree_uri: null ,
128129 }
129130 : undefined ;
130131
131- await init_or_update_workspace (workspace_root_path .data ?. path , {
132+ await init_or_update_workspace (workspace_root_path .data , {
132133 path ,
133134 recent_filenode_path ,
134135 });
148149 }
149150 : undefined ;
150151
151- await init_or_update_workspace (
152- workspace_root_path .data ?.path ,
153- {
154- path ,
155- recent_filenode_path ,
156- }
157- );
152+ await init_or_update_workspace (workspace_root_path .data , {
153+ path ,
154+ recent_filenode_path ,
155+ });
158156 }}
159157 >
160158 <div class =" size-6 i-tabler:folder-open" ></div >
Original file line number Diff line number Diff line change @@ -21,17 +21,19 @@ import {
2121 persistent_states ,
2222 type WorkspaceMetadata ,
2323} from '@/lib/states/persistent/index.svelte' ;
24+ import type { GenericPath } from '@/lib/types' ;
2425
2526// NOTE: Mainly updates only the UI States of the App
2627export async function init_or_update_workspace (
27- old_workspace_root_path : string | undefined ,
28+ old_workspace : GenericPath | undefined ,
2829 new_workspace : Omit < WorkspaceMetadata , 'last_accessed' >
2930) {
3031 try {
3132 // Prerequisites
3233 workspace_picker_dialog_open_state . data = false ;
3334 const { path : workspace_path , recent_filenode_path } = new_workspace ;
34- if ( old_workspace_root_path === workspace_path . path ) return ;
35+ if ( old_workspace ?. path === workspace_path . path ) return ;
36+ console . log ( 'Passed the return' ) ;
3537 reset_ui_states ( ) ;
3638
3739 // Actual Workspace Updation
You can’t perform that action at this time.
0 commit comments