Skip to content

Commit

Permalink
handle transient for sub maps correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
glena committed Oct 26, 2016
1 parent 5139c23 commit 344fb3c
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/core/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,14 @@ function extractUIOptions(id, options) {

const {
get: getUI,
tget: tgetUI,
set: setUI,
tset: tsetUI
set: setUI
} = dataFns(["core", "ui"]);

const {
get: tgetUI,
set: tsetUI
} = dataFns(["core", "transient", "ui"]);

const getUIAttribute = (m, attribute) => {
return tgetUI(m, attribute) || getUI(m, attribute);
};
Expand Down Expand Up @@ -496,19 +499,19 @@ export function overrideOptions(m, opts) {

if (opts.theme) {
if (opts.theme.primaryColor) {
m = tsetUI(m, ["primaryColor"], opts.theme.primaryColor);
m = tset(m, ["ui", "primaryColor"], opts.theme.primaryColor);
}

if (opts.theme.logo) {
m = tsetUI(m, ["logo"], opts.theme.logo);
m = tset(m, ["ui", "logo"], opts.theme.logo);
}
}

if (opts.language) {
opts.dict = opts.dict || {};

m = tsetUI(m, ["language"], opts.language);
m = tsetUI(m, ["dict"], opts.dict);
m = tset(m, ["ui", "language"], opts.language);
m = tset(m, ["ui", "dict"], opts.dict);

m = i18n.initI18n(m);
}
Expand All @@ -518,4 +521,4 @@ export function overrideOptions(m, opts) {
}

return m;
}
}

0 comments on commit 344fb3c

Please sign in to comment.