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

Desktop, Mobile: Add button on Synchronization to Joplin Cloud login screen (#10569)

This commit is contained in:
pedr 2024-06-12 11:11:30 -03:00 committed by GitHub
parent f5ceb4064c
commit 73d3f92ae2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 26 additions and 0 deletions

View File

@ -243,6 +243,24 @@ class ConfigScreenComponent extends React.Component<any, any> {
</div>
);
if (settings['sync.target'] === SyncTargetRegistry.nameToId('joplinCloud')) {
const goToJoplinCloudLogin = () => {
this.props.dispatch({
type: 'NAV_GO',
routeName: 'JoplinCloudLogin',
});
};
settingComps.push(
<div key="connect_to_joplin_cloud_button" style={this.rowStyle_}>
<Button
title={_('Connect to Joplin Cloud')}
level={ButtonLevel.Primary}
onClick={goToJoplinCloudLogin}
/>
</div>,
);
}
settingComps.push(
<div key="check_sync_config_button" style={this.rowStyle_}>
<Button

View File

@ -86,6 +86,10 @@ class ConfigScreenComponent extends BaseScreenComponent<ConfigScreenProps, Confi
shared.init(reg);
}
private goToJoplinCloudLogin_ = async () => {
await NavService.go('JoplinCloudLogin');
};
private checkSyncConfig_ = async () => {
if (this.state.settings['sync.target'] === SyncTargetRegistry.nameToId('joplinCloud')) {
const isAuthenticated = await reg.syncTarget().isAuthenticated();
@ -461,6 +465,10 @@ class ConfigScreenComponent extends BaseScreenComponent<ConfigScreenProps, Confi
</View>
);
if (settings['sync.target'] === SyncTargetRegistry.nameToId('joplinCloud')) {
addSettingButton('go_to_joplin_cloud_login_button', _('Connect to Joplin Cloud'), this.goToJoplinCloudLogin_);
}
addSettingButton('check_sync_config_button', _('Check synchronisation configuration'), this.checkSyncConfig_, { statusComp: statusComp });
}
}