SupportHelper: Redo Platform
This commit is contained in:
parent
bc66432d9c
commit
35222b9292
1 changed files with 21 additions and 10 deletions
|
|
@ -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}](<https://github.com/Equicord/Equicord/commit/${gitHash}>)` +
|
||||
`${SettingsPlugin.additionalInfo} - ${Intl.DateTimeFormat("en-GB", { dateStyle: "medium" }).format(BUILD_TIMESTAMP)}`,
|
||||
Client: `${RELEASE_CHANNEL} ~ ${client}`,
|
||||
Platform: platform
|
||||
Platform: platformName()
|
||||
};
|
||||
|
||||
if (IS_DISCORD_DESKTOP) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue