mirror of
https://github.com/Sevichecc/raycast-akkoma-extension.git
synced 2025-04-30 22:49:30 +08:00
fix: handle undefined value in Promise.all for mediaIds
This commit is contained in:
parent
1ce94ec7de
commit
af7cf9044d
1 changed files with 2 additions and 2 deletions
|
@ -73,7 +73,7 @@ export default function SimpleCommand(props: CommandProps) {
|
||||||
value.files?.map(async (file) => {
|
value.files?.map(async (file) => {
|
||||||
const { id } = await apiServer.uploadAttachment({ file, description: value.description });
|
const { id } = await apiServer.uploadAttachment({ file, description: value.description });
|
||||||
return id;
|
return id;
|
||||||
})
|
}) ?? []
|
||||||
);
|
);
|
||||||
|
|
||||||
const newStatus: Partial<StatusRequest> = {
|
const newStatus: Partial<StatusRequest> = {
|
||||||
|
@ -96,7 +96,7 @@ export default function SimpleCommand(props: CommandProps) {
|
||||||
cw: "",
|
cw: "",
|
||||||
}));
|
}));
|
||||||
cache.set("latest_published_status", JSON.stringify(response));
|
cache.set("latest_published_status", JSON.stringify(response));
|
||||||
setTimeout(() => popToRoot, 2000);
|
setTimeout(() => popToRoot(), 2000);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
const requestErr = error as AkkomaError;
|
const requestErr = error as AkkomaError;
|
||||||
showToast(Toast.Style.Failure, "Error", requestErr.message);
|
showToast(Toast.Style.Failure, "Error", requestErr.message);
|
||||||
|
|
Loading…
Reference in a new issue