From 17f894348fcd8fc02ec898079f3ba994074f872b Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 13 Dec 2023 18:21:17 +0900 Subject: [PATCH] fix(client): fix glitch when attach/detach avatar decoration --- .../settings/profile.avatar-decoration-dialog.vue | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/frontend/src/pages/settings/profile.avatar-decoration-dialog.vue b/packages/frontend/src/pages/settings/profile.avatar-decoration-dialog.vue index c27a21217..b7ea4c152 100644 --- a/packages/frontend/src/pages/settings/profile.avatar-decoration-dialog.vue +++ b/packages/frontend/src/pages/settings/profile.avatar-decoration-dialog.vue @@ -77,19 +77,21 @@ async function attach() { angle: angle.value, flipH: flipH.value, }; + const update = [...$i.avatarDecorations, decoration]; await os.apiWithDialog('i/update', { - avatarDecorations: [...$i.avatarDecorations, decoration], + avatarDecorations: update, }); - $i.avatarDecorations = [...$i.avatarDecorations, decoration]; + $i.avatarDecorations = update; dialog.value.close(); } async function detach() { + const update = $i.avatarDecorations.filter(x => x.id !== props.decoration.id); await os.apiWithDialog('i/update', { - avatarDecorations: $i.avatarDecorations.filter(x => x.id !== props.decoration.id), + avatarDecorations: update, }); - $i.avatarDecorations = $i.avatarDecorations.filter(x => x.id !== props.decoration.id); + $i.avatarDecorations = update; dialog.value.close(); }