From 35222b9292b5b1dac0154672f2ef36d85bcc4a74 Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Sat, 12 Jul 2025 09:31:45 -0400 Subject: [PATCH] SupportHelper: Redo Platform --- src/plugins/_core/supportHelper.tsx | 31 +++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/src/plugins/_core/supportHelper.tsx b/src/plugins/_core/supportHelper.tsx index c222c6a48..3fcfdbfd6 100644 --- a/src/plugins/_core/supportHelper.tsx +++ b/src/plugins/_core/supportHelper.tsx @@ -74,7 +74,26 @@ function getWindowsName(release: string) { if (build >= 10240) return "Windows 10"; if (build >= 9200) return "Windows 8.1"; if (build >= 7600) return "Windows 7"; - return "Windows"; + return `Windows (${release})`; +} + +function getMacOSName(release: string) { + const major = parseInt(release.split(".")[0]); + if (major === 24) return "MacOS 15 (Sequoia)"; + if (major === 23) return "MacOS 14 (Sonoma)"; + if (major === 22) return "MacOS 13 (Ventura)"; + if (major === 21) return "MacOS 12 (Monterey)"; + if (major === 20) return "MacOS 11 (Big Sur)"; + if (major === 19) return "MacOS 10.15 (Catalina)"; + return `MacOS (${release})`; +} + +function platformName() { + if (typeof DiscordNative === "undefined") return window.navigator.platform; + if (DiscordNative.process.platform === "win32") return `${getWindowsName(DiscordNative.os.release)}`; + if (DiscordNative.process.platform === "darwin") return `${getMacOSName(DiscordNative.os.release)} (${DiscordNative.process.arch === "arm64" ? "Apple Silicon" : "Intel Silicon"})`; + if (DiscordNative.process.platform === "linux") return `Linux (${DiscordNative.os.release})`; + return DiscordNative.process.platform; } async function generateDebugInfoMessage() { @@ -91,20 +110,12 @@ async function generateDebugInfoMessage() { return `${name} (${navigator.userAgent})`; })(); - const platform = typeof DiscordNative !== "undefined" - ? DiscordNative.process.platform === "win32" - ? `${getWindowsName(DiscordNative.os.release)}` - : DiscordNative.process.platform === "darwin" - ? (DiscordNative.process.arch === "arm64" ? "MacSilicon" : "MacIntel") - : DiscordNative.process.platform - : window.navigator.platform; - const info = { Equicord: `v${VERSION} • [${gitHash}]()` + `${SettingsPlugin.additionalInfo} - ${Intl.DateTimeFormat("en-GB", { dateStyle: "medium" }).format(BUILD_TIMESTAMP)}`, Client: `${RELEASE_CHANNEL} ~ ${client}`, - Platform: platform + Platform: platformName() }; if (IS_DISCORD_DESKTOP) {