From b59030d86300128cfa485036100cb592256b48c8 Mon Sep 17 00:00:00 2001 From: Seedgou Date: Fri, 5 Jan 2024 10:05:42 +0800 Subject: [PATCH] add linux in default platforms --- .../search/composables/getDefaultPlatforms.ts | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/src/components/search/composables/getDefaultPlatforms.ts b/src/components/search/composables/getDefaultPlatforms.ts index 16b8f95..f16c895 100644 --- a/src/components/search/composables/getDefaultPlatforms.ts +++ b/src/components/search/composables/getDefaultPlatforms.ts @@ -1,14 +1,23 @@ -type Platform = "android" | "common" | "freebsd" | "linux" | "netbsd" | "openbsd" | "osx" | "windows" | "sunos"; +type Platform = + | "android" + | "common" + | "freebsd" + | "linux" + | "netbsd" + | "openbsd" + | "osx" + | "windows" + | "sunos"; export function getDefaultPlatforms(): Platform[] { - const platforms: Platform[] = ["common"]; + const platforms: Platform[] = ["common", "linux"]; const navigatorPlatform = navigator?.platform?.toLowerCase(); if (navigatorPlatform.includes("android")) { platforms.push("android"); } - if (navigatorPlatform.includes("freebsd")){ + if (navigatorPlatform.includes("freebsd")) { platforms.push("freebsd"); } @@ -21,11 +30,11 @@ export function getDefaultPlatforms(): Platform[] { return platforms; } - if (navigatorPlatform.includes("netbsd")){ + if (navigatorPlatform.includes("netbsd")) { platforms.push("netbsd"); } - if (navigatorPlatform.includes("openbsd")){ + if (navigatorPlatform.includes("openbsd")) { platforms.push("openbsd"); return platforms; } @@ -62,11 +71,11 @@ export function getDefaultPlatforms(): Platform[] { platforms.push("osx"); } - if (uaPlatform.includes("netbsd")){ + if (uaPlatform.includes("netbsd")) { platforms.push("netbsd"); } - if (uaPlatform.includes("openbsd")){ + if (uaPlatform.includes("openbsd")) { platforms.push("openbsd"); }