From a97af6bb4eefa627b6e409a47e13f73686496c8c Mon Sep 17 00:00:00 2001 From: EbonCorvin <153107703+EbonCorvin@users.noreply.github.com> Date: Wed, 26 Jun 2024 07:29:57 -0400 Subject: [PATCH] Fix the bug of checked checkbox would remain checked on the friends at the same position after turned to the other page (#833) Co-authored-by: EbonCorvin <{ID}+{username}@users.noreply.github.com> --- html/src/app.js | 5 +++++ html/src/mixins/tabs/friendsList.pug | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/html/src/app.js b/html/src/app.js index 456fb069..0b897da4 100644 --- a/html/src/app.js +++ b/html/src/app.js @@ -22430,6 +22430,11 @@ speechSynthesis.getVoices(); $app.data.friendsListSelectAllCheckbox = false; $app.data.friendsListBulkUnfriendMode = false; + $app.watch.friendsListBulkUnfriendMode = (newV) => { + if (!newV) { + $app.friendsListTable.data.forEach(i => delete i.$selected); + } + } $app.methods.showBulkUnfriendSelectionConfirm = function () { var elementsTicked = 0; for (var ctx of this.friendsListTable.data) { diff --git a/html/src/mixins/tabs/friendsList.pug b/html/src/mixins/tabs/friendsList.pug index adf74205..83d19562 100644 --- a/html/src/mixins/tabs/friendsList.pug +++ b/html/src/mixins/tabs/friendsList.pug @@ -32,7 +32,7 @@ mixin friendsListTab() el-table-column(v-if="friendsListBulkUnfriendMode" width="55" prop="$selected") template(v-once #default="scope") el-button(type="text" size="mini" @click.stop) - el-checkbox(v-model="scope.row.$selected") + el-checkbox(@change="$app.$set(scope.row, '$selected', $event)" :value="'$selected' in scope.row?scope.row.$selected:false") el-table-column(:label="$t('table.friendList.no')" width="70" prop="$friendNum" sortable="custom") el-table-column(:label="$t('table.friendList.avatar')" width="70" prop="photo") template(v-once #default="scope")