- 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.
24 lines
664 B
TypeScript
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 };
|
|
};
|