mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-23 06:03:09 +02:00
fix(client): fix glitch when attach/detach avatar decoration
This commit is contained in:
parent
5472f4b934
commit
17f894348f
1 changed files with 6 additions and 4 deletions
|
@ -77,19 +77,21 @@ async function attach() {
|
||||||
angle: angle.value,
|
angle: angle.value,
|
||||||
flipH: flipH.value,
|
flipH: flipH.value,
|
||||||
};
|
};
|
||||||
|
const update = [...$i.avatarDecorations, decoration];
|
||||||
await os.apiWithDialog('i/update', {
|
await os.apiWithDialog('i/update', {
|
||||||
avatarDecorations: [...$i.avatarDecorations, decoration],
|
avatarDecorations: update,
|
||||||
});
|
});
|
||||||
$i.avatarDecorations = [...$i.avatarDecorations, decoration];
|
$i.avatarDecorations = update;
|
||||||
|
|
||||||
dialog.value.close();
|
dialog.value.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
async function detach() {
|
async function detach() {
|
||||||
|
const update = $i.avatarDecorations.filter(x => x.id !== props.decoration.id);
|
||||||
await os.apiWithDialog('i/update', {
|
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();
|
dialog.value.close();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue