Files
Folo/packages/internal/utils/src/environment.ts
T
Innei 4d746522f1 refactor: remove unused files and clean up project structure
- Deleted obsolete configuration files and unused components across various packages.
- Updated package.json files to reflect the removal of dependencies.
- Cleaned up code by removing unnecessary exports and unused imports in multiple modules.

Signed-off-by: Innei <tukon479@gmail.com>
2025-04-28 20:58:51 +08:00

28 lines
702 B
TypeScript

import { IN_ELECTRON, MODE } from "@follow/shared/constants"
import { nanoid } from "nanoid"
import { detectBrowser, getOS } from "./utils"
declare const APP_VERSION: string
export const appSessionTraceId = nanoid()
export const getCurrentEnvironment = () => {
const ua = navigator.userAgent
const appVersion = APP_VERSION
const env = IN_ELECTRON ? "electron" : "web"
const os = getOS()
const browser = detectBrowser()
return [
"### Environment",
"",
`**App Version**: ${appVersion}`,
`**OS**: ${os}`,
`**User Agent**: ${ua}`,
`**Env**: ${env}`,
`**Browser**: ${browser}`,
`**Session Trace Id**: \`${appSessionTraceId}\``,
`**Mode**: ${MODE}`,
]
}