summaryrefslogtreecommitdiff
path: root/packages/frontend/src/components/MkPostForm.vue
diff options
context:
space:
mode:
Diffstat (limited to 'packages/frontend/src/components/MkPostForm.vue')
-rw-r--r--packages/frontend/src/components/MkPostForm.vue11
1 files changed, 10 insertions, 1 deletions
diff --git a/packages/frontend/src/components/MkPostForm.vue b/packages/frontend/src/components/MkPostForm.vue
index f1fa870991..56683b8f8c 100644
--- a/packages/frontend/src/components/MkPostForm.vue
+++ b/packages/frontend/src/components/MkPostForm.vue
@@ -959,7 +959,16 @@ async function post(ev?: MouseEvent) {
if (postAccount.value) {
const storedAccounts = await getAccounts();
- token = storedAccounts.find(x => x.id === postAccount.value?.id)?.token;
+ const storedAccount = storedAccounts.find(x => x.id === postAccount.value?.id);
+ if (storedAccount && storedAccount.token != null) {
+ token = storedAccount.token;
+ } else {
+ await os.alert({
+ type: 'error',
+ text: 'cannot find the token of the selected account.',
+ });
+ return;
+ }
}
posting.value = true;