diff --git a/packages/client/src/pages/timeline.vue b/packages/client/src/pages/timeline.vue index d093676280..8aec6496d9 100644 --- a/packages/client/src/pages/timeline.vue +++ b/packages/client/src/pages/timeline.vue @@ -152,46 +152,50 @@ function top(): void { scroll(rootEl, { top: 0 }); } -const lists = await os.api("users/lists/list"); -function chooseList(ev: MouseEvent) { - const items = [ - { - type: "link" as const, - text: i18n.ts.manageLists, - icon: "ph-faders-horizontal ph-bold ph-lg", - to: "/my/lists", - }, - ].concat( - lists.map((list) => ({ - type: "link" as const, - text: list.name, - icon: "", - to: `/timeline/list/${list.id}`, - })) - ); - os.popupMenu(items, ev.currentTarget ?? ev.target); +const lists = os.api("users/lists/list"); +async function chooseList(ev: MouseEvent) { + await lists.then((res) => { + const items = [ + { + type: "link" as const, + text: i18n.ts.manageLists, + icon: "ph-faders-horizontal ph-bold ph-lg", + to: "/my/lists", + }, + ].concat( + res.map((list) => ({ + type: "link" as const, + text: list.name, + icon: "", + to: `/timeline/list/${list.id}`, + })) + ); + os.popupMenu(items, ev.currentTarget ?? ev.target); + }); } -const antennas = await os.api("antennas/list"); -function chooseAntenna(ev: MouseEvent) { - const items = [ - { - type: "link" as const, - indicate: false, - text: i18n.ts.manageAntennas, - icon: "ph-faders-horizontal ph-bold ph-lg", - to: "/my/antennas", - }, - ].concat( - antennas.map((antenna) => ({ - type: "link" as const, - text: antenna.name, - icon: "", - indicate: antenna.hasUnreadNote, - to: `/timeline/antenna/${antenna.id}`, - })) - ); - os.popupMenu(items, ev.currentTarget ?? ev.target); +const antennas = os.api("antennas/list"); +async function chooseAntenna(ev: MouseEvent) { + await antennas.then((res) => { + const items = [ + { + type: "link" as const, + indicate: false, + text: i18n.ts.manageAntennas, + icon: "ph-faders-horizontal ph-bold ph-lg", + to: "/my/antennas", + }, + ].concat( + res.map((antenna) => ({ + type: "link" as const, + text: antenna.name, + icon: "", + indicate: antenna.hasUnreadNote, + to: `/timeline/antenna/${antenna.id}`, + })) + ); + os.popupMenu(items, ev.currentTarget ?? ev.target); + }); } function saveSrc(