Alert for already alphabetized

This commit is contained in:
Yukino Song
2025-05-28 22:07:54 +08:00
parent d89f3f75d3
commit 251ae915a6
3 changed files with 12 additions and 2 deletions

View File

@@ -591,8 +591,16 @@
this.listReordered = true;
},
alphabetizeApps() {
this.apps.sort((a, b) => a.name.localeCompare(b.name));
this.listReordered = true;
let orderStat = 0;
this.apps.sort((a, b) => {
const result = a.name.localeCompare(b.name);
orderStat += result;
return result;
});
this.listReordered = orderStat !== this.apps.length - 1;
if (!this.listReordered) {
alert(this.$t('apps.already_ordered'));
}
},
saveOrder() {
this.actionDisabled = true;

View File

@@ -37,6 +37,7 @@
"allow_client_commands": "Allow client prepare commands",
"allow_client_commands_desc": "Whether to execute client prepare commands when running this app.",
"alphabetize": "Alphabetize",
"already_ordered": "Apps are already alphabetized.",
"app_name": "Application Name",
"app_name_desc": "Application Name, as shown on Moonlight",
"applications_desc": "Applications are refreshed when a session is terminated.",

View File

@@ -37,6 +37,7 @@
"allow_client_commands": "允许客户端准备命令",
"allow_client_commands_desc": "在此APP运行时是否允许执行客户端准备命令",
"alphabetize": "按字母排序",
"already_ordered": "应用已按字母排序。",
"app_name": "应用名称",
"app_name_desc": "在 Moonlight 显示的应用名称",
"applications_desc": "应用列表在会话终止时刷新",