Commit be345c45 authored by Chunchi Che's avatar Chunchi Che

fix announce

parent fa612074
......@@ -38,14 +38,15 @@ export default async (announce: MsgAnnounce) => {
}
case MsgAnnounce.AnnounceType.Card: {
announceModal.title = fetchStrings("!system", 564);
announceModal.options = await Promise.all(
announce.options.map(async (option) => ({
info: await fetchCard(option.code).then(
(meta) => meta.text.name ?? "[?]"
),
response: option.response,
}))
);
for (const option of announce.options) {
const meta = await fetchCard(option.code);
if (meta.text.name) {
announceModal.options.push({
info: meta.text.name,
response: option.response,
});
}
}
announceModal.isOpen = true;
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment