diff options
author | Nuckyz <61953774+Nuckyz@users.noreply.github.com> | 2023-01-23 18:04:50 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-23 22:04:50 +0100 |
commit | 75050e74ca01856f9b48867d7945e2b7263b42ae (patch) | |
tree | f2e72a2fc9b006f8e33ef75261651d22cfa4f6b7 /src/plugins/messageLogger | |
parent | 8a43e9b25f97cda19a5dc85020152020873c6a8e (diff) | |
download | Vencord-75050e74ca01856f9b48867d7945e2b7263b42ae.tar.gz Vencord-75050e74ca01856f9b48867d7945e2b7263b42ae.tar.bz2 Vencord-75050e74ca01856f9b48867d7945e2b7263b42ae.zip |
ShowHiddenChannels: better ui, alternative display mode (#446)
Co-authored-by: Ven <vendicated@riseup.net>
Diffstat (limited to 'src/plugins/messageLogger')
-rw-r--r-- | src/plugins/messageLogger/index.tsx | 23 |
1 files changed, 2 insertions, 21 deletions
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 ( <ErrorBoundary noop> <div className="messageLogger-edited"> @@ -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 }; }, @@ -313,17 +305,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 find: "id:\"remove-reactions\"", |