Fix cloudFile account bootstrap
This commit is contained in:
parent
911eb27fd9
commit
37561a6a18
1 changed files with 12 additions and 2 deletions
|
|
@ -14,7 +14,18 @@ export class CloudFileProvider {
|
||||||
|
|
||||||
async initialize() {
|
async initialize() {
|
||||||
const accounts = await this.cloudFileApi.getAllAccounts();
|
const accounts = await this.cloudFileApi.getAllAccounts();
|
||||||
await Promise.all(accounts.map(account => this.ensureAccount(account)));
|
await Promise.all(
|
||||||
|
accounts.map(async account => {
|
||||||
|
try {
|
||||||
|
await this.ensureAccount(account);
|
||||||
|
} catch (caughtError) {
|
||||||
|
logError("Failed to synchronize cloudFile account state", {
|
||||||
|
accountId: account.id,
|
||||||
|
error: caughtError instanceof Error ? caughtError.message : String(caughtError)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
async ensureAccount(account) {
|
async ensureAccount(account) {
|
||||||
|
|
@ -24,7 +35,6 @@ export class CloudFileProvider {
|
||||||
await this.cloudFileApi.updateAccount(account.id, {
|
await this.cloudFileApi.updateAccount(account.id, {
|
||||||
configured: isConfigured,
|
configured: isConfigured,
|
||||||
managementUrl: this.managementUrlFor(account.id),
|
managementUrl: this.managementUrlFor(account.id),
|
||||||
name: config?.displayName || account.name || "PsiTransfer",
|
|
||||||
uploadSizeLimit: -1,
|
uploadSizeLimit: -1,
|
||||||
spaceRemaining: -1,
|
spaceRemaining: -1,
|
||||||
spaceUsed: -1
|
spaceUsed: -1
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue