fix emoji dropdown

This commit is contained in:
derpystuff 2023-11-26 20:45:48 +01:00
parent dea9e04641
commit ba73854391
2 changed files with 7 additions and 2 deletions

View file

@ -175,6 +175,11 @@ module.exports = {
const emojiAsset = platformEmoji.images.filter((p)=>{ const emojiAsset = platformEmoji.images.filter((p)=>{
return p.id == ctx.data.values[0] return p.id == ctx.data.values[0]
}) })
// this sucks but works, ensures the newly selected option stays selected
for (let i = 0; i < components.components[0].components[0].options.length; i++) {
components.components[0].components[0].options[i].default = (components.components[0].components[0].options[i].value == ctx.data.values[0])
}
currentView = createEmbed("default", context, { currentView = createEmbed("default", context, {
author: { author: {
@ -199,7 +204,7 @@ module.exports = {
return { return {
label: r.version, label: r.version,
value: r.id, value: r.id,
default: (r.id == res.data.latest) default: (r.id == res.data.platforms[args.type].images[0].id)
} }
}) })

View file

@ -726,7 +726,7 @@ module.exports.EMOJIPEDIA_PLATFORM_TYPES = [
] ]
module.exports.EMOJIPEDIA_PLATFORM_TYPE_ALIASES = { module.exports.EMOJIPEDIA_PLATFORM_TYPE_ALIASES = {
"fluent": "microsoft-teams", "fluent": "microsoft-3D-fluent",
"twemoji": "twitter", "twemoji": "twitter",
"playstation": "sony", "playstation": "sony",
"ios": "apple", "ios": "apple",