diff options
author | 2023-02-07 18:34:54 +0100 | |
---|---|---|
committer | 2023-02-07 18:34:54 +0100 | |
commit | 52fbb3e58472657289b4ea3583393a91ebf853d8 (patch) | |
tree | 91da784108ab26902da1dcda38e1bba55b15a538 /web/source/settings/admin/emoji/remote/parse-from-toot.js | |
parent | [bugfix] Use SignatureCheck middleware for web profile endpoints too (#1451) (diff) | |
download | gotosocial-52fbb3e58472657289b4ea3583393a91ebf853d8.tar.xz |
[bugfix] fix 'steal this look' form, uncheck entries after processing (#1454)
Diffstat (limited to 'web/source/settings/admin/emoji/remote/parse-from-toot.js')
-rw-r--r-- | web/source/settings/admin/emoji/remote/parse-from-toot.js | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/web/source/settings/admin/emoji/remote/parse-from-toot.js b/web/source/settings/admin/emoji/remote/parse-from-toot.js index 84bbbdc92..905deee30 100644 --- a/web/source/settings/admin/emoji/remote/parse-from-toot.js +++ b/web/source/settings/admin/emoji/remote/parse-from-toot.js @@ -115,12 +115,26 @@ function CopyEmojiForm({ localEmojiCodes, type, emojiList }) { const form = { selectedEmoji: useCheckListInput("selectedEmoji", { entries: emojiList, - uniqueKey: "shortcode" + uniqueKey: "id" }), category: useComboBoxInput("category") }; - const [formSubmit, result] = useFormSubmit(form, query.usePatchRemoteEmojisMutation(), { changedOnly: false }); + const [formSubmit, result] = useFormSubmit( + form, + query.usePatchRemoteEmojisMutation(), + { + changedOnly: false, + onFinish: ({ data }) => { + if (data != undefined) { + form.selectedEmoji.updateMultiple( + // uncheck all successfully processed emoji + data.map(([id]) => [id, { checked: false }]) + ); + } + } + } + ); const buttonsInactive = form.selectedEmoji.someSelected ? {} |