mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
return useAnonMode if accounts is undefined
This commit is contained in:
@@ -14,6 +14,12 @@ const useAnonMode = (threadCid, execute) => {
|
||||
|
||||
if (!storedAccounts[threadCid] && execute) {
|
||||
await createAccount();
|
||||
|
||||
if(accounts.length === 0) {
|
||||
console.log("No accounts available");
|
||||
return;
|
||||
}
|
||||
|
||||
const lastAccount = accounts[accounts.length - 1];
|
||||
await setActiveAccount(lastAccount.name);
|
||||
storedAccounts[threadCid] = lastAccount.name;
|
||||
|
||||
Reference in New Issue
Block a user