diff --git a/Library/_res/0BDFDB.data.json b/Library/_res/0BDFDB.data.json index 1cef1fff4e..858f0a64f9 100644 --- a/Library/_res/0BDFDB.data.json +++ b/Library/_res/0BDFDB.data.json @@ -46,13 +46,12 @@ "CopyLinkUtils": {"props": ["SUPPORTS_COPY", "copy"]}, "CurrentUserStore": {"props": ["getCurrentUser"]}, "CurrentVoiceUtils": {"props": ["getAveragePing", "getChannelId"]}, - "CustomStatusConstants": {"props": ["ClearAfterValues", "STATUS_MAX_LENGTH"]}, "DesktopNotificationUtils": {"props": ["showNotification", "requestPermission"]}, "DirectMessageStore": {"props": ["getPrivateChannelIds"]}, "DirectMessageUnreadStore": {"props": ["getUnreadPrivateChannelIds"]}, + "DirectMessageUtils": {"props": ["addRecipient", "openPrivateChannel"]}, "DispatchApiUtils": {"props": ["dirtyDispatch", "isDispatching"]}, "DispatchUtils": {"props": ["ComponentDispatch"]}, - "DirectMessageUtils": {"props": ["addRecipient", "openPrivateChannel"]}, "EmojiUtils": {"props": ["translateInlineEmojiToSurrogates", "translateSurrogatesToInlineEmoji"]}, "EmojiStateUtils": {"props": ["getURL", "isEmojiDisabled"]}, "Env": {"props": ["env"]}, diff --git a/Plugins/CustomStatusPresets/CustomStatusPresets.plugin.js b/Plugins/CustomStatusPresets/CustomStatusPresets.plugin.js index 948299fd36..917d41df81 100644 --- a/Plugins/CustomStatusPresets/CustomStatusPresets.plugin.js +++ b/Plugins/CustomStatusPresets/CustomStatusPresets.plugin.js @@ -2,7 +2,7 @@ * @name CustomStatusPresets * @author DevilBro * @authorId 278543574059057154 - * @version 1.0.8 + * @version 1.0.9 * @description Allows you to save Custom Statuses as Quick Select * @invite Jx3TjNS * @donate https://www.paypal.me/MircoWittrien @@ -17,7 +17,7 @@ module.exports = (_ => { "info": { "name": "CustomStatusPresets", "author": "DevilBro", - "version": "1.0.8", + "version": "1.0.9", "description": "Allows you to save Custom Statuses as Quick Select" } }; @@ -71,6 +71,13 @@ module.exports = (_ => { var _this; var presets = {}; + const ClearAfterValues = { + HOURS_1: 3600000 + HOURS_4: 14400000 + MINUTES_30: 1800000 + TODAY: "TODAY" + }; + const CustomStatusInputComponent = class CustomStatusInput extends BdApi.React.Component { handleChange() { this.props.onChange(this.props); @@ -380,11 +387,11 @@ module.exports = (_ => { ] }), imageUrl: presets[id].emojiInfo && (presets[id].emojiInfo.id ? BDFDB.LibraryModules.IconUtils.getEmojiURL(presets[id].emojiInfo) : BDFDB.LibraryModules.EmojiStateUtils.getURL(presets[id].emojiInfo.name)), - hint: !presets[id].clearAfter ? BDFDB.LanguageUtils.LanguageStrings.DISPLAY_OPTION_NEVER : presets[id].clearAfter == BDFDB.LibraryModules.CustomStatusConstants.ClearAfterValues.TODAY ? BDFDB.LanguageUtils.LanguageStrings.CUSTOM_STATUS_TODAY : BDFDB.LanguageUtils.LanguageStringsFormat("CUSTOM_STATUS_HOURS", presets[id].clearAfter/3600000), + hint: !presets[id].clearAfter ? BDFDB.LanguageUtils.LanguageStrings.DISPLAY_OPTION_NEVER : presets[id].clearAfter == CustomStatusConstants.ClearAfterValues.TODAY ? BDFDB.LanguageUtils.LanguageStrings.CUSTOM_STATUS_TODAY : BDFDB.LanguageUtils.LanguageStringsFormat("CUSTOM_STATUS_HOURS", presets[id].clearAfter/3600000), action: _ => { if (!presets[id]) return; let expiresAt = presets[id].clearAfter ? presets[id].clearAfter : null; - if (presets[id].clearAfter === BDFDB.LibraryModules.CustomStatusConstants.ClearAfterValues.TODAY) { + if (presets[id].clearAfter === ClearAfterValues.TODAY) { let date = new Date; expiresAt = new Date(date.getFullYear(), date.getMonth(), date.getDate() + 1).getTime() - date.getTime(); }