From af7cf9044d6a3501c03ce50ed5ae7d441fc18638 Mon Sep 17 00:00:00 2001 From: sevichecc <91365763+Sevichecc@users.noreply.github.com> Date: Mon, 17 Apr 2023 00:43:27 +0800 Subject: [PATCH] fix: handle undefined value in Promise.all for mediaIds --- src/simple-status.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/simple-status.tsx b/src/simple-status.tsx index fd33169..69f9233 100644 --- a/src/simple-status.tsx +++ b/src/simple-status.tsx @@ -73,7 +73,7 @@ export default function SimpleCommand(props: CommandProps) { value.files?.map(async (file) => { const { id } = await apiServer.uploadAttachment({ file, description: value.description }); return id; - }) + }) ?? [] ); const newStatus: Partial = { @@ -96,7 +96,7 @@ export default function SimpleCommand(props: CommandProps) { cw: "", })); cache.set("latest_published_status", JSON.stringify(response)); - setTimeout(() => popToRoot, 2000); + setTimeout(() => popToRoot(), 2000); } catch (error) { const requestErr = error as AkkomaError; showToast(Toast.Style.Failure, "Error", requestErr.message);