You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-06-12 22:57:38 +02:00
Various fixes
This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user