mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[frontend] Use new GET custom_emoji admin api (#908)
* use new GET custom_emoji admin api * use url instead of static_url, add link to emoji admin api tracking issue * fetch all local emoji
This commit is contained in:
@ -37,6 +37,7 @@ function emptyBlock() {
|
||||
|
||||
function emptyEmojiForm() {
|
||||
return {
|
||||
id: Date.now(),
|
||||
shortcode: ""
|
||||
};
|
||||
}
|
||||
@ -53,6 +54,7 @@ module.exports = createSlice({
|
||||
},
|
||||
newInstanceBlocks: {},
|
||||
emoji: {},
|
||||
emojiById: {},
|
||||
newEmoji: emptyEmojiForm()
|
||||
},
|
||||
reducers: {
|
||||
@ -113,6 +115,7 @@ module.exports = createSlice({
|
||||
}
|
||||
state.emoji[emoji.category] = defaultValue(state.emoji[emoji.category], []);
|
||||
state.emoji[emoji.category].push(emoji);
|
||||
state.emojiById[emoji.id] = emoji;
|
||||
});
|
||||
},
|
||||
|
||||
@ -124,8 +127,12 @@ module.exports = createSlice({
|
||||
if (emoji.category == undefined) {
|
||||
emoji.category = "Unsorted";
|
||||
}
|
||||
if (emoji.id == undefined) {
|
||||
emoji.id = Date.now();
|
||||
}
|
||||
state.emoji[emoji.category] = defaultValue(state.emoji[emoji.category], []);
|
||||
state.emoji[emoji.category].push(emoji);
|
||||
state.emojiById[emoji.id] = emoji;
|
||||
},
|
||||
}
|
||||
});
|
Reference in New Issue
Block a user