diff --git a/src/index.ts b/src/index.ts index d71b95f..19ed979 100644 --- a/src/index.ts +++ b/src/index.ts @@ -3,10 +3,10 @@ import { defaultSettings } from "./lib/consts"; import "./style.css"; import { registerSettings } from "./Components/Settings"; export const CommonConsts = { - isUpdatingStatus: false + isUpdatingStatus: false, }; export const PluginInjector = new Injector(); -export const { utils: PluginInjectorUtils }= PluginInjector; +export const { utils: PluginInjectorUtils } = PluginInjector; export const PluginLogger = Logger.plugin("FakeDeafen"); export const SettingValues = await settings.init("dev.tharki.FakeDeafen", defaultSettings); export const { diff --git a/src/lib/requiredModules.ts b/src/lib/requiredModules.ts index ef99540..c29a6b1 100644 --- a/src/lib/requiredModules.ts +++ b/src/lib/requiredModules.ts @@ -1,17 +1,19 @@ import { webpack } from "replugged"; import * as Types from "../types"; -export const WindowInfoStore = webpack.getByProps( +export const WindowInfoStore = webpack.getByProps( "isFocused", "isElementFullScreen", "addChangeListener", "removeChangeListener", -) as Types.WindowInfoStore; +); export const KeybindUtilsModule = webpack.getBySource("numpad plus"); export const KeybindUtils = { toCombo: webpack.getFunctionBySource(KeybindUtilsModule, "numpad plus"), - toEvent: webpack.getFunctionBySource(KeybindUtilsModule, /(?=.*keyCode)(?=.*BROWSER)/), + toEvent: webpack.getFunctionBySource(KeybindUtilsModule, /(?=.*keyCode)(?=.*BROWSER)/), } as Types.KeybindUtils; -export const SoundUtilsModule = webpack.getBySource(/function.*\.disableSounds.*\.getSoundpack\(\).*play\(\).*return/); +export const SoundUtilsModule = webpack.getBySource( + /function.*\.disableSounds.*\.getSoundpack\(\).*play\(\).*return/, +); export const SoundUtils = { createSound: webpack.getFunctionBySource(SoundUtilsModule, "return new"), createSoundpackSound: webpack.getFunctionBySource(SoundUtilsModule, ");return"), @@ -23,10 +25,8 @@ export const StatusPickerClasses = webpack.getByProps "statusItem", ); - -export const GatewayConnectionStore = webpack.getBySource( - "GatewayConnectionStore", -); +export const GatewayConnectionStore = + webpack.getBySource("GatewayConnectionStore"); export const MediaEngineActions = webpack.getByProps( "toggleSelfMute", @@ -38,9 +38,7 @@ export const NotificationSettingsStore = webpack.getByProps( - "Masks.PANEL_BUTTON", -); +export const PanelButton = webpack.getBySource("Masks.PANEL_BUTTON"); export const AccountDetailsClasses = webpack.getByProps( "godlike", diff --git a/src/lib/utils.ts b/src/lib/utils.ts index 33057d6..8aff338 100644 --- a/src/lib/utils.ts +++ b/src/lib/utils.ts @@ -1,5 +1,5 @@ import { common, util } from "replugged"; -import { PluginInjector, SettingValues, CommonConsts, lodash } from "../index"; +import { CommonConsts, PluginInjector, SettingValues, lodash } from "../index"; import { AccountDetailsClasses, MediaEngineActions, diff --git a/src/patches/Menu.tsx b/src/patches/Menu.tsx index 95506d0..c362088 100644 --- a/src/patches/Menu.tsx +++ b/src/patches/Menu.tsx @@ -8,10 +8,7 @@ import * as Types from "../types"; export const patchStatusPicker = (): void => { PluginInjectorUtils.addMenuItem(Types.DefaultTypes.ContextMenuTypes.Account, (_data, menu) => { - if ( - !SettingValues.get("statusPicker", defaultSettings.statusPicker) - ) - return; + if (!SettingValues.get("statusPicker", defaultSettings.statusPicker)) return; const enabled = SettingValues.get("enabled", defaultSettings.enabled); const Icon = Utils.addStyle(Icons.sound("16", "16"), { marginLeft: "-2px", @@ -28,7 +25,7 @@ export const patchStatusPicker = (): void => { }} />, ); - const { children } = menu as {children: Types.ReactElement[]}; + const { children } = menu as { children: Types.ReactElement[] }; const switchAccount = children.find((c) => c?.props?.children?.key === "switch-account"); if (!children.find((c) => c?.props?.className === "tharki")) children.splice( @@ -78,6 +75,5 @@ export const patchStatusPicker = (): void => { }} />, ); - return; - }) + }); };