ui: Move locked themes at the end of the list
This commit is contained in:
parent
4d7161281d
commit
0a7b40abd7
1 changed files with 8 additions and 3 deletions
|
@ -33,7 +33,8 @@ export const themes = derived(
|
|||
}
|
||||
const size = arr.length;
|
||||
const rng = new seedrandom($my && $my.team_id ? $my.team_id : 0);
|
||||
const resp = [];
|
||||
const respD = [];
|
||||
const respE = [];
|
||||
const keys = [];
|
||||
|
||||
for(let i=0;i<size;i++) keys.push(i);
|
||||
|
@ -41,10 +42,14 @@ export const themes = derived(
|
|||
const r = Math.floor(rng() * keys.length);
|
||||
const g = keys[r];
|
||||
keys.splice(r,1);
|
||||
resp.push(arr[g]);
|
||||
if (arr[g].locked) {
|
||||
respD.push(arr[g]);
|
||||
} else {
|
||||
respE.push(arr[g]);
|
||||
}
|
||||
}
|
||||
|
||||
return resp;
|
||||
return respE.concat(respD);
|
||||
},
|
||||
);
|
||||
|
||||
|
|
Reference in a new issue