refactor: remove dead code (#3337)

This commit is contained in:
Hampus authored and GitHub committed 2026-10-09 01:41:26 +02:00
1 parent a19002652b
commit 93d1f8af46
1527 files changed
+21170 -73846

No files matched your search

@@ -15,7 +15,7 @@ import {generateSnowflake} from '@fluxer/snowflake/src/Snowflake';
const logger = new Logger('DeveloperOptions');
type AttachmentMock = DeveloperOptionsState['mockAttachmentStates'][string];
export type MockIncomingCallVariant = 'dm' | 'group-dm';
type MockIncomingCallVariant = 'dm' | 'group-dm';
function publishLayoutResize(): void {
ComponentBus.dispatch('LAYOUT_RESIZED');
@@ -119,10 +119,6 @@ export function clearAllAttachmentMocks(): void {
publishLayoutResize();
}
export function triggerMockIncomingCall(): void {
triggerVariant('dm');
}
export function triggerMockIncomingCallDM(): void {
triggerVariant('dm');
}
@@ -168,7 +168,7 @@ export function resetPremiumStateOverrides(): void {
DeveloperOptionsCommands.updateOption('unreadGiftInventoryCountOverride', null);
}
export const isPremiumScenarioOverride = (scenario: PremiumScenarioOption): scenario is PremiumScenarioOverride =>
const isPremiumScenarioOverride = (scenario: PremiumScenarioOption): scenario is PremiumScenarioOverride =>
scenario !== 'none' && scenario !== 'reset';
export const applyPremiumScenarioOption = (scenario: PremiumScenarioOption) => {
if (scenario === 'none') return;
@@ -58,30 +58,4 @@ export class DeveloperApplication {
static from(application: DeveloperApplicationInput): DeveloperApplication {
return new DeveloperApplication(application);
}
withUpdates(updates: Partial<DeveloperApplicationWire>): DeveloperApplication {
return new DeveloperApplication({
...this.toObject(),
...updates,
redirect_uris: updates.redirect_uris ?? this.redirect_uris,
bot: updates.bot ?? this.bot,
});
}
toObject(): DeveloperApplicationWire {
return {
id: this.id,
name: this.name,
redirect_uris: [...this.redirect_uris],
bot_public: this.bot_public,
bot_require_code_grant: this.bot_require_code_grant,
client_secret: this.client_secret,
bot: this.bot
? {
...this.bot,
flags: this.bot.flags,
}
: undefined,
};
}
}
@@ -2,7 +2,7 @@
const DEVTOOLS_DOCK_THRESHOLD_PX = 160;
export type DevtoolsDockOrientation = 'horizontal' | 'vertical';
type DevtoolsDockOrientation = 'horizontal' | 'vertical';
export interface DevtoolsViewportSnapshot {
outerWidth: number;
@@ -45,7 +45,7 @@ function captureViewportSnapshot(): DevtoolsViewportSnapshot {
};
}
export function detectDevtoolsDockState(snapshot: DevtoolsViewportSnapshot): DevtoolsDockState {
function detectDevtoolsDockState(snapshot: DevtoolsViewportSnapshot): DevtoolsDockState {
const wideGap = widthGap(snapshot) > DEVTOOLS_DOCK_THRESHOLD_PX;
const tallGap = heightGap(snapshot) > DEVTOOLS_DOCK_THRESHOLD_PX;
if (!(wideGap && tallGap) && (snapshot.legacyDebuggerPresent || wideGap || tallGap)) {
@@ -50,7 +50,7 @@ function getSelfXssMessage(descriptor: MessageDescriptor, values?: Record<string
return formatFallbackMessage(descriptor.message ?? descriptor.id, values);
}
export function printSelfXssNotice(consoleApi: ConsoleLike = console): void {
function printSelfXssNotice(consoleApi: ConsoleLike = console): void {
consoleApi.log(`%c${getSelfXssMessage(STOP_DESCRIPTOR)}`, STOP_BANNER_STYLE);
consoleApi.log(`%c${getSelfXssMessage(DEVELOPER_TOOL_DESCRIPTOR)}`, SUPPORTING_COPY_STYLE);
consoleApi.log(
@@ -60,7 +60,7 @@ export function printSelfXssNotice(consoleApi: ConsoleLike = console): void {
consoleApi.log(`%c${getSelfXssMessage(ONLY_RUN_CODE_DESCRIPTOR)}`, CAUTION_COPY_STYLE);
}
export function queueSelfXssNoticeBurst(consoleApi: ConsoleLike = console): () => void {
function queueSelfXssNoticeBurst(consoleApi: ConsoleLike = console): () => void {
const timeoutIds: Array<NodeJS.Timeout> = [];
for (let repeatIndex = 0; repeatIndex < SELF_XSS_NOTICE_REPEAT_COUNT; repeatIndex++) {
if (repeatIndex === 0) {