Merge pull request #8626 from kuangp/fix/shortcuts
fix(shortcuts): make writable copies of saved shortcuts from storageApi
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-shortcuts': patch
|
||||
---
|
||||
|
||||
Properly read saved shortcuts from StorageApi
|
||||
@@ -82,11 +82,9 @@ export class LocalStoredShortcuts implements ShortcutApi {
|
||||
};
|
||||
|
||||
private get() {
|
||||
return (
|
||||
(this.storageApi.get('items') as Shortcut[])?.sort((a, b) =>
|
||||
a.title >= b.title ? 1 : -1,
|
||||
) ?? []
|
||||
);
|
||||
return Array.from(
|
||||
this.storageApi.snapshot<Shortcut[]>('items').value ?? [],
|
||||
).sort((a, b) => (a.title >= b.title ? 1 : -1));
|
||||
}
|
||||
|
||||
private notify() {
|
||||
|
||||
Reference in New Issue
Block a user