From 75050e74ca01856f9b48867d7945e2b7263b42ae Mon Sep 17 00:00:00 2001 From: Nuckyz <61953774+Nuckyz@users.noreply.github.com> Date: Mon, 23 Jan 2023 18:04:50 -0300 Subject: ShowHiddenChannels: better ui, alternative display mode (#446) Co-authored-by: Ven --- src/plugins/messageLogger/index.tsx | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) (limited to 'src/plugins/messageLogger') diff --git a/src/plugins/messageLogger/index.tsx b/src/plugins/messageLogger/index.tsx index 50a6f52..8c7fa11 100644 --- a/src/plugins/messageLogger/index.tsx +++ b/src/plugins/messageLogger/index.tsx @@ -23,8 +23,7 @@ import ErrorBoundary from "@components/ErrorBoundary"; import { Devs } from "@utils/constants"; import Logger from "@utils/Logger"; import definePlugin, { OptionType } from "@utils/types"; -import { findByPropsLazy } from "@webpack"; -import { Parser, UserStore } from "@webpack/common"; +import { moment, Parser, Timestamp, UserStore } from "@webpack/common"; function addDeleteStyleClass() { if (Settings.plugins.MessageLogger.deleteStyle === "text") { @@ -41,13 +40,7 @@ export default definePlugin({ description: "Temporarily logs deleted and edited messages.", authors: [Devs.rushii, Devs.Ven], - timestampModule: null as any, - moment: null as Function | null, - start() { - this.moment = findByPropsLazy("relativeTimeRounding", "relativeTimeThreshold"); - this.timestampModule = findByPropsLazy("messageLogger_TimestampComponent"); - addDeleteStyleClass(); }, @@ -59,7 +52,6 @@ export default definePlugin({ }, renderEdit(edit: { timestamp: any, content: string; }) { - const Timestamp = this.timestampModule.messageLogger_TimestampComponent; return (
@@ -78,7 +70,7 @@ export default definePlugin({ makeEdit(newMessage: any, oldMessage: any): any { return { - timestamp: this.moment?.call(newMessage.edited_timestamp), + timestamp: moment?.call(newMessage.edited_timestamp), content: oldMessage.content }; }, @@ -312,17 +304,6 @@ export default definePlugin({ ] }, - { - // Message "(edited)" timestamp component - // Module 23552 - find: "Messages.MESSAGE_EDITED_TIMESTAMP_A11Y_LABEL.format", - replacement: { - // Re-export the timestamp component under a findable name - match: /{(\w{1,2}:\(\)=>(\w{1,2}))}/, - replace: "{$1,messageLogger_TimestampComponent:()=>$2}" - } - }, - { // Message context base menu // Module 600300 -- cgit