forked from Shinonome/dots-hyprland
replace for loop with findIndex
This commit is contained in:
@@ -155,12 +155,8 @@ ContentPage {
|
|||||||
})]
|
})]
|
||||||
|
|
||||||
currentIndex: {
|
currentIndex: {
|
||||||
for (let i = 0; i < model.length; i++) {
|
const index = model.findIndex(item => item.value === Config.options.language.ui);
|
||||||
if (model[i].value === Config.options.language.ui) {
|
return index !== -1 ? index : 0;
|
||||||
return i;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onActivated: index => {
|
onActivated: index => {
|
||||||
|
|||||||
Reference in New Issue
Block a user