Correct shortcode attr, sort names instead of emoji, success info

This commit is contained in:
Ekaterina Vaartis 2025-08-15 22:12:56 +03:00
commit 7ff72e5ae2
2 changed files with 15 additions and 16 deletions

View file

@ -98,13 +98,18 @@
this.$store.state.api.backendInteractor.addNewEmojiFile({ this.$store.state.api.backendInteractor.addNewEmojiFile({
packName: this.packName, packName: this.packName,
file: this.$attrs.src, file: this.$attrs.src,
shortcode: this.$attrs.shortcode, shortcode: this.shortcode,
filename: "" filename: ""
}).then(resp => resp.json()).then(resp => { }).then(resp => resp.json()).then(resp => {
if (resp.error !== undefined) { if (resp.error !== undefined) {
this.displayError(resp.error) this.displayError(resp.error)
return return
} }
useInterfaceStore().pushGlobalNotice({
messageKey: 'admin_dash.emoji.copied_successfully',
messageArgs: [this.shortcode, this.packName],
level: 'success'
})
this.$refs.emojiPopover.hidePopover() this.$refs.emojiPopover.hidePopover()
this.packName = '' this.packName = ''
@ -143,21 +148,14 @@
this.loadPacksPaginated(this.$store.state.api.backendInteractor.listEmojiPacks) this.loadPacksPaginated(this.$store.state.api.backendInteractor.listEmojiPacks)
.then(allPacks => { .then(allPacks => {
this.knownLocalPacks = allPacks
for (const name of Object.keys(this.knownLocalPacks)) {
this.sortPackFiles(name)
}
})
},
sortPackFiles (nameOfPack) {
// Sort by key // Sort by key
const sorted = Object.keys(this.knownLocalPacks[nameOfPack].files).sort().reduce((acc, key) => { const sorted = Object.keys(allPacks).sort().reduce((acc, key) => {
if (key.length === 0) return acc if (key.length === 0) return acc
acc[key] = this.knownLocalPacks[nameOfPack].files[key] acc[key] = allPacks[key]
return acc return acc
}, {}) }, {})
this.knownLocalPacks[nameOfPack].files = sorted this.knownLocalPacks = sorted
})
} }
} }
} }

View file

@ -1223,7 +1223,8 @@
"delete_title": "Delete?", "delete_title": "Delete?",
"metadata_changed": "Metadata different from saved", "metadata_changed": "Metadata different from saved",
"emoji_changed": "Unsaved emoji file changes, check highlighted emoji", "emoji_changed": "Unsaved emoji file changes, check highlighted emoji",
"replace_warning": "This will REPLACE the local pack of the same name" "replace_warning": "This will REPLACE the local pack of the same name",
"copied_successfully": "Successfully copied emoji \"{0}\" to pack \"{1}\""
}, },
"temp_overrides": { "temp_overrides": {
":pleroma": { ":pleroma": {