diff --git a/.changeset/hip-hounds-remember.md b/.changeset/hip-hounds-remember.md new file mode 100644 index 0000000000..c600c88b3f --- /dev/null +++ b/.changeset/hip-hounds-remember.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-shortcuts': patch +--- + +Properly read saved shortcuts from StorageApi diff --git a/plugins/shortcuts/src/api/LocalStoredShortcuts.ts b/plugins/shortcuts/src/api/LocalStoredShortcuts.ts index 8a713b9b8f..ef54f68acd 100644 --- a/plugins/shortcuts/src/api/LocalStoredShortcuts.ts +++ b/plugins/shortcuts/src/api/LocalStoredShortcuts.ts @@ -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('items').value ?? [], + ).sort((a, b) => (a.title >= b.title ? 1 : -1)); } private notify() {