Compare commits
2 commits
9fdb933ba3
...
48af94224b
Author | SHA1 | Date | |
---|---|---|---|
48af94224b | |||
db50f53f6d |
1 changed files with 5 additions and 4 deletions
9
index.ts
9
index.ts
|
@ -15,12 +15,13 @@ import { PluginMeta } from "~plugins";
|
||||||
|
|
||||||
import SettingsPlugin from "../../plugins/_core/settings";
|
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 version = IS_DISCORD_DESKTOP ? DiscordNative.app.getVersion() : IS_VESKTOP ? VesktopNative.app.getVersion() : null;
|
||||||
|
// @ts-ignore
|
||||||
const name = IS_DISCORD_DESKTOP ? "Desktop" : IS_VESKTOP ? "Vesktop" : typeof unsafeWindow !== "undefined" ? "UserScript" : "Web";
|
const name = IS_DISCORD_DESKTOP ? "Desktop" : IS_VESKTOP ? "Vesktop" : typeof unsafeWindow !== "undefined" ? "UserScript" : "Web";
|
||||||
|
|
||||||
return `${name}${version ? ` v${version}` : ""}`;
|
return `${name}${version ? ` v${version}` : ''}`;
|
||||||
})();
|
};
|
||||||
const uptime = Date.now();
|
const uptime = Date.now();
|
||||||
|
|
||||||
const lines = `\
|
const lines = `\
|
||||||
|
@ -113,7 +114,7 @@ export default definePlugin({
|
||||||
const { username } = UserStore.getCurrentUser();
|
const { username } = UserStore.getCurrentUser();
|
||||||
const info: Record<string, string | null> = {
|
const info: Record<string, string | null> = {
|
||||||
version: `${VERSION} ~ ${gitHash}${SettingsPlugin.additionalInfo} - ${Intl.DateTimeFormat(navigator.language, { dateStyle: "medium" }).format(BUILD_TIMESTAMP)}`,
|
version: `${VERSION} ~ ${gitHash}${SettingsPlugin.additionalInfo} - ${Intl.DateTimeFormat(navigator.language, { dateStyle: "medium" }).format(BUILD_TIMESTAMP)}`,
|
||||||
client: `${t(window.GLOBAL_ENV.RELEASE_CHANNEL)} ~ ${VERSION}`,
|
client: `${t(window.GLOBAL_ENV.RELEASE_CHANNEL)} ~ ${clientVersion()}`,
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
platform: navigator.userAgentData?.platform ?? navigator.platform,
|
platform: navigator.userAgentData?.platform ?? navigator.platform,
|
||||||
plugins: getEnabledPlugins(),
|
plugins: getEnabledPlugins(),
|
||||||
|
|
Loading…
Reference in a new issue