fixup d843b4e2: a shallow copy is needed
This commit is contained in:
parent
50239a49df
commit
538da08a95
|
@ -318,13 +318,12 @@ function filterStylesInternal({
|
||||||
const styles = id === null
|
const styles = id === null
|
||||||
? cachedStyles.list
|
? cachedStyles.list
|
||||||
: [cachedStyles.byId.get(id)];
|
: [cachedStyles.byId.get(id)];
|
||||||
const filtered = asHash ? blankHash : [];
|
|
||||||
if (!styles[0]) {
|
if (!styles[0]) {
|
||||||
// may happen when users [accidentally] reopen an old URL
|
// may happen when users [accidentally] reopen an old URL
|
||||||
// of edit.html with a non-existent style id parameter
|
// of edit.html with a non-existent style id parameter
|
||||||
return filtered;
|
return asHash ? blankHash : [];
|
||||||
}
|
}
|
||||||
|
const filtered = asHash ? {} : [];
|
||||||
const needSections = asHash || matchUrl !== null;
|
const needSections = asHash || matchUrl !== null;
|
||||||
const matchUrlBase = matchUrl && matchUrl.includes('#') && matchUrl.split('#', 1)[0];
|
const matchUrlBase = matchUrl && matchUrl.includes('#') && matchUrl.split('#', 1)[0];
|
||||||
|
|
||||||
|
@ -361,7 +360,10 @@ function filterStylesInternal({
|
||||||
cleanupCachedFilters();
|
cleanupCachedFilters();
|
||||||
}
|
}
|
||||||
|
|
||||||
return filtered;
|
// a shallow copy is needed because the cache doesn't store options like disableAll
|
||||||
|
return asHash
|
||||||
|
? Object.assign(blankHash, filtered)
|
||||||
|
: filtered;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user