agent-ecosystem/landing/composables/usePlatform.ts
iliya e6e89d4ebc fix(tests): improve messageId generation for legacy inbox rows
- Enhanced tests to ensure consistent messageId generation for legacy inbox rows lacking a messageId.
- Updated test descriptions for better clarity regarding the new messageId handling.
- Adjusted test expectations to align with the updated behavior of relaying legacy inbox rows with generated messageIds.
2026-03-23 16:31:37 +02:00

24 lines
664 B
TypeScript

import { computed, onMounted, ref } from "vue";
import { detectMacArch, detectPlatform } from "~/utils/platform";
export const usePlatform = () => {
const platform = ref("unknown");
const arch = ref("unknown");
onMounted(() => {
const ua = navigator.userAgent;
platform.value = detectPlatform(ua);
if (platform.value === "macos") {
arch.value = detectMacArch(ua);
}
});
const label = computed(() => {
if (platform.value === "macos") return "macOS";
if (platform.value === "windows") return "Windows";
if (platform.value === "linux") return "Linux";
return "your OS";
});
return { platform, arch, label };
};