From af42693ea1cbb070d04a521862447d7f977e6faa Mon Sep 17 00:00:00 2001 From: tamaina Date: Sat, 29 Jan 2022 16:52:44 +0000 Subject: [PATCH] Fix --- packages/client/src/components/ui/menu.vue | 2 +- packages/client/src/types/menu.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/client/src/components/ui/menu.vue b/packages/client/src/components/ui/menu.vue index c5cb4b477..a93cc8cda 100644 --- a/packages/client/src/components/ui/menu.vue +++ b/packages/client/src/components/ui/menu.vue @@ -82,7 +82,7 @@ watch(() => props.items, () => { if (item && 'then' in item) { // if item is Promise items[i] = { type: 'pending' }; item.then(actualItem => { - items[i] = actualItem; + items2[i] = actualItem; }); } } diff --git a/packages/client/src/types/menu.ts b/packages/client/src/types/menu.ts index d178a8208..ed67e6ab8 100644 --- a/packages/client/src/types/menu.ts +++ b/packages/client/src/types/menu.ts @@ -15,5 +15,6 @@ export type MenuButton = { type?: 'button', text: string, icon?: string, indicat export type MenuPending = { type: 'pending' }; type OuterMenuItem = MenuDivider | MenuNull | MenuLabel | MenuLink | MenuA | MenuUser | MenuSwitch | MenuButton; -export type MenuItem = OuterMenuItem | Promise; +type OuterPromiseMenuItem = Promise; +export type MenuItem = OuterMenuItem | OuterPromiseMenuItem; export type InnerMenuItem = MenuDivider | MenuPending | MenuLabel | MenuLink | MenuA | MenuUser | MenuSwitch | MenuButton;