summaryrefslogtreecommitdiff
path: root/launcher/components
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2025-08-05 18:05:18 +0800
committerlittleblack111 <littleblack11111@gmail.com>2025-08-07 17:27:45 +0800
commit374215148a08f75f84adf730187986735b18c45b (patch)
tree3d8a0184e7e07235301a67d255f866d891556593 /launcher/components
parent336432ad45c8ca02acfb3e731561c385dd2cba74 (diff)
perf(launcher:selection): if check instead of function clamp
Diffstat (limited to 'launcher/components')
-rw-r--r--launcher/components/SelectionState.qml9
1 files changed, 4 insertions, 5 deletions
diff --git a/launcher/components/SelectionState.qml b/launcher/components/SelectionState.qml
index d945d70..2e53155 100644
--- a/launcher/components/SelectionState.qml
+++ b/launcher/components/SelectionState.qml
@@ -12,13 +12,12 @@ Singleton {
// order them based on widgets(which came from order from config)
onPrioritiesChanged: {
- // priorities = priorities.filter(item => item.priority === true); // bind loop
- // dunno y ts works w/o triggering a binding loop but okay..
- for (let i = 0; i < priorities.length; i++)
- if (priorities[i].priority !== true)
+ for (let i = priorities.length - 1; i >= 0; i--)
+ if (!priorities[i] || priorities[i].priority !== true)
priorities.splice(i, 1);
- priorities.sort((a, b) => widgets.indexOf(a) - widgets.indexOf(b));
+ priorities.sort((a, b) => (widgets.indexOf(a) - widgets.indexOf(b)) || 0);
+
priorities.forEach((item, index) => {});
}