fix nin0ware
Signed-off-by: duke <duke@git.nin0.dev>
This commit is contained in:
parent
b3f0d7a0fd
commit
db50f53f6d
1 changed files with 5 additions and 4 deletions
9
index.ts
9
index.ts
|
@ -14,12 +14,13 @@ import { GuildMemberStore, UserStore } from "@webpack/common";
|
|||
import { PluginMeta } from "~plugins";
|
||||
import SettingsPlugin from "../../plugins/_core/settings";
|
||||
|
||||
const clientVersion = (() => {
|
||||
const clientVersion = () => {
|
||||
const version = IS_DISCORD_DESKTOP ? DiscordNative.app.getVersion() : IS_VESKTOP ? VesktopNative.app.getVersion() : null;
|
||||
const name = IS_DISCORD_DESKTOP ? 'Desktop' : IS_VESKTOP ? "Vesktop" : typeof unsafeWindow !== "undefined" ? "UserScript" : "Web";
|
||||
// @ts-ignore
|
||||
const name = IS_DISCORD_DESKTOP ? "Desktop" : IS_VESKTOP ? "Vesktop" : typeof unsafeWindow !== "undefined" ? "UserScript" : "Web";
|
||||
|
||||
return `${name}${version ? ` v${version}` : ''}`;
|
||||
})();
|
||||
};
|
||||
let uptime = Date.now();
|
||||
|
||||
const lines = `\
|
||||
|
@ -112,7 +113,7 @@ export default definePlugin({
|
|||
const { username } = UserStore.getCurrentUser();
|
||||
const info: Record<string, string | null> = {
|
||||
version: `${VERSION} ~ ${gitHash}${SettingsPlugin.additionalInfo} - ${Intl.DateTimeFormat(navigator.language, { dateStyle: "medium" }).format(BUILD_TIMESTAMP)}`,
|
||||
client: `${t(window.GLOBAL_ENV.RELEASE_CHANNEL)} ~ ${clientVersion}`,
|
||||
client: `${t(window.GLOBAL_ENV.RELEASE_CHANNEL)} ~ ${clientVersion()}`,
|
||||
// @ts-ignore
|
||||
platform: navigator.userAgentData?.platform ?? navigator.platform,
|
||||
plugins: getEnabledPlugins(),
|
||||
|
|
Loading…
Reference in a new issue