1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-24 21:42:51 -05:00

displays: workaround for duplicate models

This commit is contained in:
bbedward
2025-11-27 10:34:18 -05:00
parent 384c775f1a
commit 28ad641070
5 changed files with 92 additions and 10 deletions

View File

@@ -1486,17 +1486,26 @@ Item {
currentPrefs = [];
}
const screenModelIndex = SettingsData.getScreenModelIndex(screenData);
let newPrefs = currentPrefs.filter(pref => {
if (typeof pref === "string")
return false;
if (pref.modelIndex !== undefined && screenModelIndex >= 0) {
return !(pref.model === screenData.model && pref.modelIndex === screenModelIndex);
}
return pref.name !== screenData.name || pref.model !== screenData.model;
});
if (checked) {
newPrefs.push({
const prefObj = {
name: screenData.name,
model: screenData.model || ""
});
};
if (screenModelIndex >= 0) {
prefObj.modelIndex = screenModelIndex;
}
newPrefs.push(prefObj);
}
dankBarTab.setBarScreenPreferences(selectedBarId, newPrefs);