1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-12 22:57:38 +02:00

Various fixes

This commit is contained in:
Laurent Cozic
2017-07-24 22:52:30 +01:00
parent 2685120ecd
commit 53d305eb2e
5 changed files with 38 additions and 23 deletions

View File

@ -4,6 +4,7 @@ import { connect } from 'react-redux'
import Icon from 'react-native-vector-icons/Ionicons';
import { Log } from 'lib/log.js';
import { Note } from 'lib/models/note.js';
import { Setting } from 'lib/models/setting.js';
import { FoldersScreenUtils } from 'lib/components/screens/folders-utils.js'
import { NotesScreenUtils } from 'lib/components/screens/notes-utils.js'
import { Synchronizer } from 'lib/synchronizer.js';
@ -70,21 +71,22 @@ class SideMenuContentComponent extends Component {
}
async synchronize_press() {
if (Setting.value('sync.target') == Setting.SYNC_TARGET_ONEDRIVE && !reg.oneDriveApi().auth()) {
this.props.dispatch({ type: 'SIDE_MENU_CLOSE' });
this.props.dispatch({
type: 'Navigation/NAVIGATE',
routeName: 'OneDriveLogin',
});
return;
}
const sync = await reg.synchronizer(Setting.value('sync.target'))
if (this.props.syncStarted) {
sync.cancel();
} else {
if (reg.oneDriveApi().auth()) {
reg.scheduleSync(1);
} else {
this.props.dispatch({ type: 'SIDE_MENU_CLOSE' });
this.props.dispatch({
type: 'Navigation/NAVIGATE',
routeName: 'OneDriveLogin',
});
}
reg.scheduleSync(0);
}
}