Skip to content

Commit

Permalink
Fix analytics #276
Browse files Browse the repository at this point in the history
  • Loading branch information
Levminer committed Jan 8, 2024
1 parent e487aa7 commit 2fce3bd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions interface/utils/analytics.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
import { SystemInfo } from "interface/windows/settings"
import build from "../../build.json"
import { invoke, os } from "@tauri-apps/api"

export const optionalAnalyticsPayload = async () => {
const osType = (await invoke<string>("system_info")).split("+")[0]
const osName = (await invoke<SystemInfo>("system_info")).osName
const osArch = await os.arch()
const osVersion = await os.version()

return {
version: build.version,
build: build.number,
os: `${osType} ${osArch.replace("x86_64", "x64")} ${osVersion}`,
os: `${osName} ${osArch.replace("x86_64", "x64")} ${osVersion}`,
lang: navigator.language,
date: new Date(),
}
Expand Down
2 changes: 1 addition & 1 deletion interface/windows/settings/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { getSettings } from "interface/stores/settings"

const settings = getSettings()

interface SystemInfo {
export interface SystemInfo {
osName: string
osArch: string
cpuName: string
Expand Down

0 comments on commit 2fce3bd

Please sign in to comment.