Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
yofukashino committed Jun 11, 2023
1 parent 9096929 commit f9d7df7
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 21 deletions.
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
20 changes: 9 additions & 11 deletions src/lib/requiredModules.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
import { webpack } from "replugged";
import * as Types from "../types";
export const WindowInfoStore = webpack.getByProps(
export const WindowInfoStore = webpack.getByProps<Types.WindowInfoStore>(
"isFocused",
"isElementFullScreen",
"addChangeListener",
"removeChangeListener",
) as Types.WindowInfoStore;
);
export const KeybindUtilsModule = webpack.getBySource<Types.GenericModule>("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<Types.GenericModule>(/function.*\.disableSounds.*\.getSoundpack\(\).*play\(\).*return/);
export const SoundUtilsModule = webpack.getBySource<Types.GenericModule>(
/function.*\.disableSounds.*\.getSoundpack\(\).*play\(\).*return/,
);
export const SoundUtils = {
createSound: webpack.getFunctionBySource(SoundUtilsModule, "return new"),
createSoundpackSound: webpack.getFunctionBySource(SoundUtilsModule, ");return"),
Expand All @@ -23,10 +25,8 @@ export const StatusPickerClasses = webpack.getByProps<Types.StatusPickerClasses>
"statusItem",
);


export const GatewayConnectionStore = webpack.getBySource<Types.GatewayConnectionStore>(
"GatewayConnectionStore",
);
export const GatewayConnectionStore =
webpack.getBySource<Types.GatewayConnectionStore>("GatewayConnectionStore");

export const MediaEngineActions = webpack.getByProps<Types.MediaEngineActions>(
"toggleSelfMute",
Expand All @@ -38,9 +38,7 @@ export const NotificationSettingsStore = webpack.getByProps<Types.NotificationSe
"isSoundDisabled",
);

export const PanelButton = webpack.getBySource<Types.ComponentClass>(
"Masks.PANEL_BUTTON",
);
export const PanelButton = webpack.getBySource<Types.ComponentClass>("Masks.PANEL_BUTTON");

export const AccountDetailsClasses = webpack.getByProps<Types.AccountDetailsClasses>(
"godlike",
Expand Down
2 changes: 1 addition & 1 deletion src/lib/utils.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
10 changes: 3 additions & 7 deletions src/patches/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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(
Expand Down Expand Up @@ -78,6 +75,5 @@ export const patchStatusPicker = (): void => {
}}
/>,
);
return;
})
});
};

0 comments on commit f9d7df7

Please sign in to comment.