diff --git a/src/plugins/timezones/components.tsx b/src/plugins/timezones/components.tsx index aa27d3f20..0e7146c24 100644 --- a/src/plugins/timezones/components.tsx +++ b/src/plugins/timezones/components.tsx @@ -58,15 +58,17 @@ function LocalTimestampInner(props: LocalTimestampProps): JSX.Element | null { const longTime = formatTimestamp(timezone, timestamp, true); const shortTime = formatTimestamp(timezone, timestamp, false); + + if (props.type === "message" && !shortTime) + return null; + const shortTimeFormatted = props.type === "message" ? `• ${shortTime}` - : shortTime; - + : shortTime ?? "Error"; const classes = props.type === "message" ? `timezone-message-item ${messageClasses.timestamp}` : "timezone-profile-item"; - return <> {toolTipProps => <> diff --git a/src/plugins/timezones/index.tsx b/src/plugins/timezones/index.tsx index 17ffe9cf7..ad9c5d935 100644 --- a/src/plugins/timezones/index.tsx +++ b/src/plugins/timezones/index.tsx @@ -6,6 +6,7 @@ import { Devs } from "@utils/constants"; import definePlugin from "@utils/types"; +import { UserStore } from "@webpack/common"; import { Message, User } from "discord-types/general"; import { LocalTimestamp } from "./components"; @@ -30,23 +31,6 @@ export default definePlugin({ ], patches: [ - // { - // find: "copyMetaData:\"User Tag\"", - // replacement: { - // match: /return(\(0.+?}\)}\)]}\))}/, - // replace: "return [$1, $self.getProfileTimezonesComponent(arguments[0])] }", - // }, - // }, - // { - // // TODO: fix this - // // thank you https://github.com/Syncxv/vc-timezones/blob/master/index.tsx for saving me from painful work - // find: ".badgesContainer,{", - // replacement: { - // match: /id:\(0,\i\.getMessageTimestampId\)\(\i\),timestamp.{1,50}}\),/, - // replace: "$&,$self.getTimezonesComponent(arguments[0]),", - // }, - // }, - // Based on Syncxv's vc-timezones user plugin // ...[".NITRO_BANNER,", "=!1,canUsePremiumCustomization:"].map(find => ({ find, @@ -76,6 +60,7 @@ export default definePlugin({ renderMessageTimezone: (props?: { message?: Message; }) => { if (!settings.store.displayInChat || !props?.message) return null; + if (UserStore.getCurrentUser().id === props?.message?.id) return null; return