Merge pull request #8626 from kuangp/fix/shortcuts

fix(shortcuts): make writable copies of saved shortcuts from storageApi
This commit is contained in:
Fredrik Adelöw
2021-12-24 09:04:36 +01:00
committed by GitHub
2 changed files with 8 additions and 5 deletions
+5
View File
@@ -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() {