File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
typescript/packages/jumble/src/components Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -705,6 +705,28 @@ export function getCommands(deps: CommandContext): CommandItem[] {
705705 deps . setOpen ( false ) ;
706706 } ,
707707 } ,
708+ {
709+ id : "unpin-charm" ,
710+ type : "action" ,
711+ title : "Unpin Charm" ,
712+ group : "View" ,
713+ predicate : ! ! deps . focusedCharmId ,
714+ handler : async ( ) => {
715+ if ( ! deps . focusedCharmId || ! deps . focusedReplicaId ) {
716+ deps . setOpen ( false ) ;
717+ return ;
718+ }
719+
720+ const charm = await deps . charmManager . get ( deps . focusedCharmId ) ;
721+ if ( ! charm ) {
722+ console . error ( "Failed to load charm" , deps . focusedCharmId ) ;
723+ return ;
724+ }
725+
726+ await deps . charmManager . unpin ( charm ) ;
727+ deps . setOpen ( false ) ;
728+ } ,
729+ } ,
708730 {
709731 id : "view-detail" ,
710732 type : "action" ,
You can’t perform that action at this time.
0 commit comments