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:
parent
f5ceb4064c
commit
73d3f92ae2
@ -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
|
||||
|
@ -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 });
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user