Skip to content

Commit

Permalink
add linux in default platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
rwv committed Jan 5, 2024
1 parent 09137ef commit b59030d
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions src/components/search/composables/getDefaultPlatforms.ts
Original file line number Diff line number Diff line change
@@ -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");
}

Expand All @@ -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;
}
Expand Down Expand Up @@ -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");
}

Expand Down

0 comments on commit b59030d

Please sign in to comment.