@@ -5,8 +5,6 @@ import ignore, { Ignore } from 'ignore'
55import {
66 CONTEXT_CHECKED_PATHS_STATE_KEY ,
77 CONTEXT_CHECKED_TIMESTAMPS_STATE_KEY ,
8- CONTEXT_CHECKED_PATHS_FRF_STATE_KEY ,
9- CONTEXT_CHECKED_TIMESTAMPS_FRF_STATE_KEY ,
108 RANGES_STATE_KEY
119} from '@/constants/state-keys'
1210import { IGNORE_PATTERNS } from '@/constants/ignore-patterns'
@@ -226,53 +224,39 @@ export class WorkspaceProvider
226224 }
227225
228226 private async _save_checked_files_state ( ) : Promise < void > {
227+ if ( this . _is_frf_mode ) return
228+
229229 const checked_paths = this . get_all_checked_paths ( )
230- const paths_key = this . _is_frf_mode
231- ? CONTEXT_CHECKED_PATHS_FRF_STATE_KEY
232- : CONTEXT_CHECKED_PATHS_STATE_KEY
233- const times_key = this . _is_frf_mode
234- ? CONTEXT_CHECKED_TIMESTAMPS_FRF_STATE_KEY
235- : CONTEXT_CHECKED_TIMESTAMPS_STATE_KEY
236- await this . _context . workspaceState . update ( paths_key , checked_paths )
237230 await this . _context . workspaceState . update (
238- times_key ,
231+ CONTEXT_CHECKED_PATHS_STATE_KEY ,
232+ checked_paths
233+ )
234+ await this . _context . workspaceState . update (
235+ CONTEXT_CHECKED_TIMESTAMPS_STATE_KEY ,
239236 Object . fromEntries ( this . _checked_timestamps )
240237 )
241238 }
242239
243240 public load_checked_files_state ( ) {
244241 const load = async ( ) => {
245- await this . gitignore_initialization
246- const prev_mode = this . _is_frf_mode
247-
248- this . _is_frf_mode = false
249242 const reg_paths = this . _context . workspaceState . get < string [ ] > (
250243 CONTEXT_CHECKED_PATHS_STATE_KEY
251244 )
252245 const reg_times = this . _context . workspaceState . get <
253246 Record < string , number >
254247 > ( CONTEXT_CHECKED_TIMESTAMPS_STATE_KEY )
248+
249+ await this . gitignore_initialization
250+ const prev_mode = this . _is_frf_mode
251+
252+ this . _is_frf_mode = false
255253 if ( reg_paths && reg_paths . length > 0 ) {
256254 await this . set_checked_files (
257255 reg_paths ,
258256 reg_times ? new Map ( Object . entries ( reg_times ) ) : undefined
259257 )
260258 }
261259
262- this . _is_frf_mode = true
263- const frf_paths = this . _context . workspaceState . get < string [ ] > (
264- CONTEXT_CHECKED_PATHS_FRF_STATE_KEY
265- )
266- const frf_times = this . _context . workspaceState . get <
267- Record < string , number >
268- > ( CONTEXT_CHECKED_TIMESTAMPS_FRF_STATE_KEY )
269- if ( frf_paths && frf_paths . length > 0 ) {
270- await this . set_checked_files (
271- frf_paths ,
272- frf_times ? new Map ( Object . entries ( frf_times ) ) : undefined
273- )
274- }
275-
276260 this . _is_frf_mode = prev_mode
277261 }
278262 load ( )
0 commit comments