mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-08 14:13:01 -04:00
Refactor ContextMenuAPI (#2236)
This commit is contained in:
parent
612fdf8952
commit
42a9fa2d47
25 changed files with 220 additions and 245 deletions
|
@ -18,7 +18,7 @@
|
|||
|
||||
import "./messageLogger.css";
|
||||
|
||||
import { addContextMenuPatch, NavContextMenuPatchCallback, removeContextMenuPatch } from "@api/ContextMenu";
|
||||
import { NavContextMenuPatchCallback } from "@api/ContextMenu";
|
||||
import { Settings } from "@api/Settings";
|
||||
import { disableStyle, enableStyle } from "@api/Styles";
|
||||
import ErrorBoundary from "@components/ErrorBoundary";
|
||||
|
@ -45,7 +45,7 @@ function addDeleteStyle() {
|
|||
|
||||
const REMOVE_HISTORY_ID = "ml-remove-history";
|
||||
const TOGGLE_DELETE_STYLE_ID = "ml-toggle-style";
|
||||
const patchMessageContextMenu: NavContextMenuPatchCallback = (children, props) => () => {
|
||||
const patchMessageContextMenu: NavContextMenuPatchCallback = (children, props) => {
|
||||
const { message } = props;
|
||||
const { deleted, editHistory, id, channel_id } = message;
|
||||
|
||||
|
@ -94,13 +94,12 @@ export default definePlugin({
|
|||
description: "Temporarily logs deleted and edited messages.",
|
||||
authors: [Devs.rushii, Devs.Ven, Devs.AutumnVN],
|
||||
|
||||
start() {
|
||||
addDeleteStyle();
|
||||
addContextMenuPatch("message", patchMessageContextMenu);
|
||||
contextMenus: {
|
||||
"message": patchMessageContextMenu
|
||||
},
|
||||
|
||||
stop() {
|
||||
removeContextMenuPatch("message", patchMessageContextMenu);
|
||||
start() {
|
||||
addDeleteStyle();
|
||||
},
|
||||
|
||||
renderEdit(edit: { timestamp: any, content: string; }) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue