refactor
This commit is contained in:
parent
7c761e7017
commit
d336a1fb1c
|
@ -959,7 +959,16 @@ async function post(ev?: MouseEvent) {
|
||||||
|
|
||||||
if (postAccount.value) {
|
if (postAccount.value) {
|
||||||
const storedAccounts = await getAccounts();
|
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;
|
posting.value = true;
|
||||||
|
|
Loading…
Reference in New Issue