mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-08 14:13:01 -04:00
add option to hide your own timezone from showing
This commit is contained in:
parent
c7ee1bb0bf
commit
3fbc993950
1 changed files with 8 additions and 0 deletions
|
@ -27,6 +27,12 @@ const classes = findByPropsLazy("timestamp", "compact", "contentOnly");
|
||||||
const locale = findByPropsLazy("getLocale");
|
const locale = findByPropsLazy("getLocale");
|
||||||
|
|
||||||
export const settings = definePluginSettings({
|
export const settings = definePluginSettings({
|
||||||
|
"Show Own Timezone": {
|
||||||
|
type: OptionType.BOOLEAN,
|
||||||
|
description: "Show your own timezone in profiles and message headers",
|
||||||
|
default: true
|
||||||
|
},
|
||||||
|
|
||||||
"24h Time": {
|
"24h Time": {
|
||||||
type: OptionType.BOOLEAN,
|
type: OptionType.BOOLEAN,
|
||||||
description: "Show time in 24h format",
|
description: "Show time in 24h format",
|
||||||
|
@ -250,12 +256,14 @@ export default definePlugin({
|
||||||
|
|
||||||
renderProfileTimezone: (props?: { user?: User; }) => {
|
renderProfileTimezone: (props?: { user?: User; }) => {
|
||||||
if (!settings.store.showProfileTime || !props?.user?.id) return null;
|
if (!settings.store.showProfileTime || !props?.user?.id) return null;
|
||||||
|
if (props.user.id === UserStore.getCurrentUser().id && !settings.store["Show Own Timezone"]) return null;
|
||||||
|
|
||||||
return <TimestampComponent userId={props.user.id} type="profile" />;
|
return <TimestampComponent userId={props.user.id} type="profile" />;
|
||||||
},
|
},
|
||||||
|
|
||||||
renderMessageTimezone: (props?: { message?: Message; }) => {
|
renderMessageTimezone: (props?: { message?: Message; }) => {
|
||||||
if (!settings.store.showMessageHeaderTime || !props?.message) return null;
|
if (!settings.store.showMessageHeaderTime || !props?.message) return null;
|
||||||
|
if (props.message.author.id === UserStore.getCurrentUser().id && !settings.store["Show Own Timezone"]) return null;
|
||||||
|
|
||||||
return <TimestampComponent userId={props.message.author.id} timestamp={props.message.timestamp.toISOString()} type="message" />;
|
return <TimestampComponent userId={props.message.author.id} timestamp={props.message.timestamp.toISOString()} type="message" />;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue