mirror of
https://github.com/laurent22/joplin.git
synced 2025-01-23 18:53:36 +02:00
Mobile: Resolves #360: Don't crash if theme not set and improved logging.
This commit is contained in:
parent
be8bda8e73
commit
4d0af575e5
@ -100,7 +100,10 @@ function addExtraStyles(style) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function themeStyle(theme) {
|
function themeStyle(theme) {
|
||||||
if (!theme) throw new Error('Theme not set');
|
if (!theme) {
|
||||||
|
console.warn('Theme not set!! Defaulting to Light theme');
|
||||||
|
theme = Setting.THEME_LIGHT;
|
||||||
|
}
|
||||||
|
|
||||||
if (themeCache_[theme]) return themeCache_[theme];
|
if (themeCache_[theme]) return themeCache_[theme];
|
||||||
|
|
||||||
|
@ -72,8 +72,17 @@ const EncryptionService = require('lib/services/EncryptionService');
|
|||||||
|
|
||||||
let storeDispatch = function(action) {};
|
let storeDispatch = function(action) {};
|
||||||
|
|
||||||
|
const logReducerAction = function(action) {
|
||||||
|
if (['SIDE_MENU_OPEN_PERCENT', 'SYNC_REPORT_UPDATE'].indexOf(action.type) >= 0) return;
|
||||||
|
|
||||||
|
let msg = [action.type];
|
||||||
|
if (action.routeName) msg.push(action.routeName);
|
||||||
|
|
||||||
|
reg.logger().info('Reducer action', msg.join(', '));
|
||||||
|
}
|
||||||
|
|
||||||
const generalMiddleware = store => next => async (action) => {
|
const generalMiddleware = store => next => async (action) => {
|
||||||
if (['SIDE_MENU_OPEN_PERCENT', 'SYNC_REPORT_UPDATE'].indexOf(action.type) < 0) reg.logger().info('Reducer action', action.type);
|
logReducerAction(action);
|
||||||
PoorManIntervals.update(); // This function needs to be called regularly so put it here
|
PoorManIntervals.update(); // This function needs to be called regularly so put it here
|
||||||
|
|
||||||
const result = next(action);
|
const result = next(action);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user