Fix: call Object.keys twice
This commit is contained in:
parent
a7ffc9d477
commit
ae2f45a3f0
|
@ -322,13 +322,14 @@ const APPLY = (() => {
|
||||||
}
|
}
|
||||||
|
|
||||||
function applyStyles(sections) {
|
function applyStyles(sections) {
|
||||||
if (!Object.keys(sections).length) {
|
const styles = Object.values(sections);
|
||||||
|
if (!styles.length) {
|
||||||
return Promise.resolve();
|
return Promise.resolve();
|
||||||
}
|
}
|
||||||
return rootReady().then(() =>
|
return rootReady().then(() =>
|
||||||
docRootObserver.evade(() =>
|
docRootObserver.evade(() =>
|
||||||
styleInjector.addMany(
|
styleInjector.addMany(
|
||||||
Object.values(sections).map(s => ({id: s.id, code: s.code.join('')}))
|
styles.map(s => ({id: s.id, code: s.code.join('')}))
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user