Skip to content

Commit

Permalink
style: correct naming
Browse files Browse the repository at this point in the history
  • Loading branch information
FedeIlLeone committed Nov 24, 2024
1 parent 41f026f commit d782dde
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 15 deletions.
1 change: 0 additions & 1 deletion cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
"signingkey",
"Skema",
"skus",
"titlebar",
"uninject",
"uninjector",
"uninjectors",
Expand Down
8 changes: 4 additions & 4 deletions src/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ const discordPath = join(dirname(require.main!.filename), "..", "app.orig.asar")
const discordPackage = require(join(discordPath, "package.json"));
require.main!.filename = join(discordPath, discordPackage.main);

let customTitlebar: boolean;
void getSetting("dev.replugged.Settings", "titlebar", false).then(
(titlebar) => (customTitlebar = titlebar),
let customTitleBar: boolean;
void getSetting("dev.replugged.Settings", "titleBar", false).then(
(titleBar) => (customTitleBar = titleBar),
);

Object.defineProperty(global, "appSettings", {
Expand Down Expand Up @@ -40,7 +40,7 @@ class BrowserWindow extends electron.BrowserWindow {
};
},
) {
if (opts.frame && process.platform.includes("linux") && customTitlebar) opts.frame = void 0;
if (opts.frame && process.platform.includes("linux") && customTitleBar) opts.frame = void 0;

const originalPreload = opts.webPreferences?.preload;

Expand Down
10 changes: 5 additions & 5 deletions src/renderer/coremods/settings/pages/General.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ export const General = (): React.ReactElement => {
"reactDevTools",
);

const { value: titlebarValue, onChange: titlebarOnChange } = util.useSetting(
const { value: titleBarValue, onChange: titleBarOnChange } = util.useSetting(
generalSettings,
"titlebar",
"titleBar",
);
const [kKeys, setKKeys] = React.useState<number[]>([]);

Expand Down Expand Up @@ -116,10 +116,10 @@ export const General = (): React.ReactElement => {

{DiscordNative.process.platform.includes("linux") && (
<SwitchItem
value={titlebarValue}
value={titleBarValue}
onChange={(value) => {
titlebarOnChange(value);
restartModal(false);
titleBarOnChange(value);
restartModal(true);
}}
note={intl.format(t.REPLUGGED_SETTINGS_CUSTOM_TITLE_BAR_DESC, {})}>
{intl.string(t.REPLUGGED_SETTINGS_CUSTOM_TITLE_BAR)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const generalSettings = await init<GeneralSettings, keyof typeof defaultSettings
defaultSettings,
);

export default (DiscordNative.process.platform.includes("linux") && generalSettings.get("titlebar")
export default (DiscordNative.process.platform.includes("linux") && generalSettings.get("titleBar")
? [
{
find: ".appAsidePanelWrapper,",
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/managers/coremods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { default as contextMenu } from "../coremods/contextMenu/plaintextPatches
import { default as languagePlaintext } from "../coremods/language/plaintextPatches";
import { default as settingsPlaintext } from "../coremods/settings/plaintextPatches";
import { default as badgesPlaintext } from "../coremods/badges/plaintextPatches";
import { default as titlebarPlaintext } from "../coremods/titlebar/plaintextPatches";
import { default as titleBarPlaintext } from "../coremods/titleBar/plaintextPatches";
import { Logger } from "../modules/logger";

const logger = Logger.api("Coremods");
Expand Down Expand Up @@ -86,6 +86,6 @@ export function runPlaintextPatches(): void {
languagePlaintext,
settingsPlaintext,
badgesPlaintext,
titlebarPlaintext,
titleBarPlaintext,
].forEach(patchPlaintext);
}
4 changes: 2 additions & 2 deletions src/types/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export type GeneralSettings = {
showWelcomeNoticeOnOpen?: boolean;
addonEmbeds?: boolean;
reactDevTools?: boolean;
titlebar?: boolean;
titleBar?: boolean;
};

export const defaultSettings = {
Expand All @@ -25,5 +25,5 @@ export const defaultSettings = {
showWelcomeNoticeOnOpen: true,
reactDevTools: false,
addonEmbeds: true,
titlebar: false,
titleBar: false,
} satisfies Partial<GeneralSettings>;

0 comments on commit d782dde

Please sign in to comment.