Skip to content

Commit

Permalink
trying to fix emoji board
Browse files Browse the repository at this point in the history
  • Loading branch information
JasminDreasond committed Aug 11, 2023
1 parent 1f7a959 commit 2c67f3b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/app/molecules/image-pack/ImagePack.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,14 @@ function useImagePackHandles(pack, sendPackContent) {
sendPackContent(pack.getContent());
forceUpdate();
};

const handleEditProfile = (name, attribution) => {
pack.setDisplayName(name);
pack.setAttribution(attribution);
sendPackContent(pack.getContent());
forceUpdate();
};

const handleUsageChange = (newUsage) => {
const usage = [];
if (newUsage === 'emoticon' || newUsage === 'both') usage.push('emoticon');
Expand All @@ -166,7 +168,12 @@ function useImagePackHandles(pack, sendPackContent) {

sendPackContent(pack.getContent());
forceUpdate();

const roomData = getSelectRoom();
updateEmojiList(roomData && roomData.roomId ? roomData.roomId : undefined);

};

const handleDeleteItem = async (key) => {
const isConfirmed = await confirmDialog(
'Delete',
Expand All @@ -184,6 +191,7 @@ function useImagePackHandles(pack, sendPackContent) {
updateEmojiList(roomData && roomData.roomId ? roomData.roomId : undefined);

};

const handleUsageItem = (key, newUsage) => {
const usage = [];
if (newUsage === 'emoticon' || newUsage === 'both') usage.push('emoticon');
Expand All @@ -193,6 +201,7 @@ function useImagePackHandles(pack, sendPackContent) {
sendPackContent(pack.getContent());
forceUpdate();
};

const handleAddItem = (key, url) => {
const newKey = getNewKey(key);
if (!newKey || !url) return;
Expand All @@ -202,6 +211,10 @@ function useImagePackHandles(pack, sendPackContent) {
});

sendPackContent(pack.getContent());

const roomData = getSelectRoom();
updateEmojiList(roomData && roomData.roomId ? roomData.roomId : undefined);

forceUpdate();
};

Expand Down

0 comments on commit 2c67f3b

Please sign in to comment.