aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/plugins/messageActions.ts7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/plugins/messageActions.ts b/src/plugins/messageActions.ts
index 10969f9..2972cbc 100644
--- a/src/plugins/messageActions.ts
+++ b/src/plugins/messageActions.ts
@@ -1,6 +1,7 @@
import { addClickListener, removeClickListener } from '../api/MessageEvents';
import definePlugin from "../utils/types";
import { find, findByProps } from "../webpack";
+import { UserStore } from "../webpack/common";
let isDeletePressed = false;
const keydown = (e: KeyboardEvent) => e.key === "Backspace" && (isDeletePressed = true);
@@ -16,15 +17,15 @@ export default definePlugin({
const { deleteMessage, startEditMessage } = findByProps("deleteMessage");
const { can } = findByProps("can", "initialize");
const { Permissions: { MANAGE_MESSAGES } } = find(m => m.Permissions?.MANAGE_MESSAGES);
- const { getCurrentUser } = findByProps("getCurrentUser");
+ const { isEditing } = findByProps("isEditing");
document.addEventListener("keydown", keydown);
document.addEventListener("keyup", keyup);
this.onClick = addClickListener((msg, chan, event) => {
- const isMe = msg.author.id === getCurrentUser().id;
+ const isMe = msg.author.id === UserStore.getCurrentUser().id;
if (!isDeletePressed) {
- if (isMe && event.detail >= 2) {
+ if (isMe && event.detail >= 2 && !isEditing(chan.id, msg.id)) {
startEditMessage(chan.id, msg.id, msg.content);
event.preventDefault();
}