Skip to content

Commit 99e0383

Browse files
committed
fix: passing down set options in columns/rows
1 parent ec237fa commit 99e0383

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/js/base.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -196,16 +196,18 @@ const getKeyPath = (parentKey, option) => {
196196
(parentKey && option.name ? '.' : '') + (option.name || '');
197197
};
198198

199-
const addOptions = (value, save, option, key) => {
200-
if (value == null || typeof value !== 'object') {
201-
value = {};
199+
const addOptions = (values, save, option, key) => {
200+
if (values == null || typeof values !== 'object') {
201+
values = {};
202202
}
203203
return h('.suboptions', option.options.map((option) => {
204204
const optionKey = getKeyPath(key, option);
205-
return chrome.options.addOption(optionKey, value[option.name],
205+
const isLayout = option.type === 'column' || option.type === 'row';
206+
const value = isLayout ? values : values[option.name];
207+
return chrome.options.addOption(optionKey, value,
206208
(newValue) => {
207-
if (option.name) { value[option.name] = newValue; }
208-
save(value);
209+
if (option.name) { values[option.name] = newValue; }
210+
save(values);
209211
}, option);
210212
}));
211213
};

0 commit comments

Comments
 (0)