File tree Expand file tree Collapse file tree
packages/vscode/src/commands/checkpoints-command Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,7 +12,8 @@ import {
1212 clear_all_checkpoints ,
1313 delete_checkpoint ,
1414 get_checkpoints ,
15- restore_checkpoint
15+ restore_checkpoint ,
16+ toggle_checkpoint_star
1617} from './actions'
1718import { PanelProvider } from '@/views/panel/backend/panel-provider'
1819import { get_checkpoint_path } from './utils'
@@ -309,17 +310,12 @@ export const checkpoints_command = (params: {
309310 if ( ! item . checkpoint ) return
310311
311312 if ( e . button . tooltip == 'Star' || e . button . tooltip == 'Unstar' ) {
312- const checkpoint_to_update = checkpoints . find (
313- ( c ) => c . timestamp == item . checkpoint ?. timestamp
314- )
315- if ( checkpoint_to_update ) {
316- checkpoint_to_update . is_starred = ! checkpoint_to_update . is_starred
317- await params . context . workspaceState . update (
318- CHECKPOINTS_STATE_KEY ,
319- checkpoints
320- )
321- params . panel_provider . send_checkpoints ( )
322- }
313+ await toggle_checkpoint_star ( {
314+ context : params . context ,
315+ timestamp : item . checkpoint . timestamp ,
316+ panel_provider : params . panel_provider
317+ } )
318+
323319 await refresh_and_update_view ( )
324320 const active_item = quick_pick . items . find (
325321 ( i ) =>
You can’t perform that action at this time.
0 commit comments