mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-04-13 17:22:08 -04:00
fix(dankbar): use ID as tie breaker
This commit is contained in:
@@ -154,18 +154,18 @@ Item {
|
|||||||
|
|
||||||
property string _barLayoutStateJson: {
|
property string _barLayoutStateJson: {
|
||||||
const configs = SettingsData.barConfigs;
|
const configs = SettingsData.barConfigs;
|
||||||
const mapped = configs.map(c => ({
|
const mapped = configs.map((c, i) => ({
|
||||||
id: c.id,
|
id: c.id,
|
||||||
position: c.position,
|
position: c.position,
|
||||||
autoHide: c.autoHide,
|
autoHide: c.autoHide,
|
||||||
visible: c.visible
|
visible: c.visible,
|
||||||
|
_origIndex: i
|
||||||
})).sort((a, b) => {
|
})).sort((a, b) => {
|
||||||
const aVertical = a.position === SettingsData.Position.Left || a.position === SettingsData.Position.Right;
|
const aVertical = a.position === SettingsData.Position.Left || a.position === SettingsData.Position.Right;
|
||||||
const bVertical = b.position === SettingsData.Position.Left || b.position === SettingsData.Position.Right;
|
const bVertical = b.position === SettingsData.Position.Left || b.position === SettingsData.Position.Right;
|
||||||
if (aVertical !== bVertical) {
|
if (aVertical !== bVertical)
|
||||||
return aVertical - bVertical;
|
return aVertical - bVertical;
|
||||||
}
|
return a._origIndex - b._origIndex;
|
||||||
return String(a.id).localeCompare(String(b.id));
|
|
||||||
});
|
});
|
||||||
return JSON.stringify(mapped);
|
return JSON.stringify(mapped);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user