Desktop, Mobile: Fixes #10292: Email to note address not presented in configuration screen before synchronisation (#10293)

pull/10295/head
pedr 2024-04-10 07:37:00 -03:00 committed by GitHub
parent 238683e36f
commit 859d3e867e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 0 deletions

View File

@ -311,4 +311,7 @@ export default class JoplinServerApi {
}
}
public async loadSession() {
await this.session();
}
}

View File

@ -3,6 +3,8 @@ import Setting from '../models/Setting';
import { ApplicationPlatform, ApplicationType } from '../types';
import shim from '../shim';
import { _ } from '../locale';
import eventManager, { EventName } from '../eventManager';
import { reg } from '../registry';
type ActionType = 'LINK_USED' | 'COMPLETED' | 'ERROR';
type Action = {
@ -108,6 +110,11 @@ export const checkIfLoginWasSuccessful = async (applicationsUrl: string) => {
Setting.setValue('sync.10.username', jsonBody.id);
Setting.setValue('sync.10.password', jsonBody.password);
const fileApi = await reg.syncTarget().fileApi();
await fileApi.driver().api().loadSession();
eventManager.emit(EventName.SessionEstablished);
return { success: true };
};