1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +02:00

Desktop: Fixes error when Joplin Cloud login is finished before the settings are saved (#10575)

This commit is contained in:
pedr 2024-06-14 15:31:50 -03:00 committed by GitHub
parent 4952980e0a
commit 9e2b9e5b8d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -5,6 +5,7 @@ import shim from '../shim';
import { _ } from '../locale'; import { _ } from '../locale';
import eventManager, { EventName } from '../eventManager'; import eventManager, { EventName } from '../eventManager';
import { reg } from '../registry'; import { reg } from '../registry';
import SyncTargetRegistry from '../SyncTargetRegistry';
type ActionType = 'LINK_USED' | 'COMPLETED' | 'ERROR'; type ActionType = 'LINK_USED' | 'COMPLETED' | 'ERROR';
type Action = { type Action = {
@ -110,6 +111,7 @@ export const checkIfLoginWasSuccessful = async (applicationsUrl: string) => {
Setting.setValue('sync.10.username', jsonBody.id); Setting.setValue('sync.10.username', jsonBody.id);
Setting.setValue('sync.10.password', jsonBody.password); Setting.setValue('sync.10.password', jsonBody.password);
Setting.setValue('sync.target', SyncTargetRegistry.nameToId('joplinCloud'));
const fileApi = await reg.syncTarget().fileApi(); const fileApi = await reg.syncTarget().fileApi();
await fileApi.driver().api().loadSession(); await fileApi.driver().api().loadSession();