diff options
| author | HJ <30-hj@users.noreply.git.pleroma.social> | 2024-06-21 21:53:00 +0000 |
|---|---|---|
| committer | HJ <30-hj@users.noreply.git.pleroma.social> | 2024-06-21 21:53:00 +0000 |
| commit | 4c3e2979756fa374eafcd385c6fffc64d8c8ffcd (patch) | |
| tree | 71e302eb7c4901de399bef6722fe2256baaa8bdf /src/services/theme_data/iss_utils.js | |
| parent | 88f95e30e1f5528bcc97a6e26bc20469e0d896d1 (diff) | |
| parent | dc37c7b28b2142227f73a36acc27a7ac77c7e59a (diff) | |
Merge branch 'tusooa/themesv3-on-safari' into 'develop'
Fix Themes v3 not working on Safari
Closes #1319
See merge request pleroma/pleroma-fe!1918
Diffstat (limited to 'src/services/theme_data/iss_utils.js')
| -rw-r--r-- | src/services/theme_data/iss_utils.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/services/theme_data/iss_utils.js b/src/services/theme_data/iss_utils.js index 2d9dd0b5..83ca8242 100644 --- a/src/services/theme_data/iss_utils.js +++ b/src/services/theme_data/iss_utils.js @@ -1,3 +1,5 @@ +import { sortBy } from 'lodash' + // "Unrolls" a tree structure of item: { parent: { ...item2, parent: { ...item3, parent: {...} } }} // into an array [item2, item3] for iterating export const unroll = (item) => { @@ -24,7 +26,7 @@ export const getAllPossibleCombinations = (array) => { }) const flatCombos = newCombos.reduce((acc, x) => [...acc, ...x], []) const uniqueComboStrings = new Set() - const uniqueCombos = flatCombos.map(x => x.toSorted()).filter(x => { + const uniqueCombos = flatCombos.map(sortBy).filter(x => { if (uniqueComboStrings.has(x.join())) { return false } else { @@ -64,7 +66,7 @@ export const genericRuleToSelector = components => (rule, ignoreOutOfTreeSelecto } const selectors = [realSelector, applicableVariant, ...applicableStates] - .toSorted((a, b) => { + .sort((a, b) => { if (a.startsWith(':')) return 1 if (/^[a-z]/.exec(a)) return -1 else return 0 |
