From 0e05567706298b32932871da51f0f56b339d9617 Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Sat, 15 Jul 2017 17:14:15 +0100 Subject: [PATCH] VArious fixes --- CliClient/app/import-enex-md-gen.js | 6 +++++- ReactNativeClient/lib/components/side-menu-content.js | 7 ++----- ReactNativeClient/lib/onedrive-api.js | 2 +- ReactNativeClient/root.js | 5 ++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/CliClient/app/import-enex-md-gen.js b/CliClient/app/import-enex-md-gen.js index 417b79bc63..5d4af8205b 100644 --- a/CliClient/app/import-enex-md-gen.js +++ b/CliClient/app/import-enex-md-gen.js @@ -344,7 +344,11 @@ function enexXmlToMdArray(stream, resources) { let x = node.attributes && node.attributes.checked && node.attributes.checked.toLowerCase() == 'true' ? 'X' : ' '; section.lines.push('- [' + x + '] '); } else if (n == "hr") { - section.lines.push('------------------------------------------------------------------------------'); + // Needs to be surrounded by new lines so that it's properly rendered as a line when converting to HTML + section.lines.push(NEWLINE); + section.lines.push('----------------------------------------'); + section.lines.push(NEWLINE); + section.lines.push(NEWLINE); } else if (n == "h1") { section.lines.push(BLOCK_OPEN); section.lines.push("# "); } else if (n == "h2") { diff --git a/ReactNativeClient/lib/components/side-menu-content.js b/ReactNativeClient/lib/components/side-menu-content.js index 28412072e5..2f9f6b621a 100644 --- a/ReactNativeClient/lib/components/side-menu-content.js +++ b/ReactNativeClient/lib/components/side-menu-content.js @@ -2,6 +2,7 @@ import { connect } from 'react-redux' import { Button, Text } from 'react-native'; import { Log } from 'lib/log.js'; import { Note } from 'lib/models/note.js'; +import { FoldersScreenUtils } from 'lib/components/screens/folders-utils.js' import { NotesScreenUtils } from 'lib/components/screens/notes-utils.js' import { reg } from 'lib/registry.js'; import { _ } from 'lib/locale.js'; @@ -64,11 +65,7 @@ class SideMenuContentComponent extends Component { try { sync.start(options).then(async () => { - let initialFolders = await Folder.all({ includeConflictFolder: true }); - dispatch({ - type: 'FOLDERS_UPDATE_ALL', - folders: initialFolders, - }); + await FoldersScreenUtils.refreshFolders(); }); } catch (error) { Log.error(error); diff --git a/ReactNativeClient/lib/onedrive-api.js b/ReactNativeClient/lib/onedrive-api.js index c90bb1d8f0..8a76c5bacc 100644 --- a/ReactNativeClient/lib/onedrive-api.js +++ b/ReactNativeClient/lib/onedrive-api.js @@ -252,7 +252,7 @@ class OneDriveApi { if (!response.ok) { this.setAuth(null); let msg = await response.text(); - throw new Error(msg); + throw new Error(msg + ': TOKEN: ' + this.auth_); } let auth = await response.json(); diff --git a/ReactNativeClient/root.js b/ReactNativeClient/root.js index 667645cd28..56b3d76d20 100644 --- a/ReactNativeClient/root.js +++ b/ReactNativeClient/root.js @@ -248,9 +248,8 @@ async function initialize(dispatch, backButtonHandler) { const mainLogger = new Logger(); mainLogger.addTarget('database', { database: logDatabase, source: 'm' }); - mainLogger.addTarget('console'); + if (Setting.value('env') == 'env') mainLogger.addTarget('console'); mainLogger.setLevel(Logger.LEVEL_DEBUG); - mainLogger.addTarget('database', { database: logDatabase, source: 'm' }); reg.setLogger(mainLogger); @@ -259,7 +258,7 @@ async function initialize(dispatch, backButtonHandler) { const dbLogger = new Logger(); dbLogger.addTarget('database', { database: logDatabase, source: 'm' }); - dbLogger.addTarget('console'); + if (Setting.value('env') == 'env') dbLogger.addTarget('console'); dbLogger.setLevel(Logger.LEVEL_INFO); let db = new JoplinDatabase(new DatabaseDriverReactNative());