Compare commits

..

2 Commits

Author SHA1 Message Date
a31550e205 fix auto import 2024-10-09 17:34:11 -07:00
d8167a3a3d fix delete 2024-10-09 17:33:58 -07:00
2 changed files with 6 additions and 3 deletions

View File

@ -35,11 +35,11 @@ var functions = {
}; };
functions.getFiles("emoji").then(data => { functions.getFiles("emoji").then(data => {
if (!data.error) chrome.runtime.sendMessage(["storeFiles", data, "emoji"]); if (!data.error) chrome.runtime.sendMessage(["storeFiles", data.body, "emoji"]);
else console.error(data.error); else console.error(data.error);
}); });
functions.getFiles("sticker").then(data => { functions.getFiles("sticker").then(data => {
if (!data.error) chrome.runtime.sendMessage(["storeFiles", data, "sticker"]); if (!data.error) chrome.runtime.sendMessage(["storeFiles", data.body, "sticker"]);
else console.error(data.error); else console.error(data.error);
}); });

View File

@ -269,6 +269,8 @@ function createEmojiSquare({internalId, data, animationStyle, currentId_emoji, c
errorDiv.innerText = ""; errorDiv.innerText = "";
try { try {
await callContentScript("deleteFile", this.dataset["currentId_"+mode]); await callContentScript("deleteFile", this.dataset["currentId_"+mode]);
await db.updateImage(this.dataset.internalId, {["currentId_"+mode]: null});
delete this.dataset["currentId_"+mode];
} catch (error) { } catch (error) {
this.dataset.state = lastState; this.dataset.state = lastState;
select.disabled = false; select.disabled = false;
@ -287,7 +289,8 @@ function createEmojiSquare({internalId, data, animationStyle, currentId_emoji, c
}, },
async delete() { async delete() {
await db.deleteImage(this.dataset.internalId); await db.deleteImage(this.dataset.internalId);
if (this.dataset["currentId_"+mode]) callContentScript("deleteFile", this.dataset["currentId_"+mode]).catch(displayError); if (this.dataset["currentId_emoji"]) callContentScript("deleteFile", this.dataset["currentId_emoji"]).catch(displayError);
if (this.dataset["currentId_sticker"]) callContentScript("deleteFile", this.dataset["currentId_sticker"]).catch(displayError);
this.remove(); this.remove();
} }
}); });