Merge pull request #4226 from janhq/chore/hide-vulkan-option-when-there-is-no-gpu-detected

fix: hide Vulkan option for users who don't have GPU
This commit is contained in:
Louis 2024-12-05 17:34:54 +07:00 committed by GitHub
commit 41e0d4cddc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 13 additions and 12 deletions

View File

@ -4,6 +4,8 @@ import { PropsWithChildren } from 'react'
import { Provider, atom } from 'jotai' import { Provider, atom } from 'jotai'
import { FileInfo } from '@/types/file'
export const editPromptAtom = atom<string>('') export const editPromptAtom = atom<string>('')
export const currentPromptAtom = atom<string>('') export const currentPromptAtom = atom<string>('')
export const fileUploadAtom = atom<FileInfo[]>([]) export const fileUploadAtom = atom<FileInfo[]>([])
@ -15,10 +17,3 @@ export const selectedTextAtom = atom('')
export default function JotaiWrapper({ children }: PropsWithChildren) { export default function JotaiWrapper({ children }: PropsWithChildren) {
return <Provider>{children}</Provider> return <Provider>{children}</Provider>
} }
export type FileType = 'image' | 'pdf'
export type FileInfo = {
file: File
type: FileType
}

View File

@ -436,7 +436,7 @@ const Advanced = () => {
)} )}
{/* Vulkan for AMD GPU/ APU and Intel Arc GPU */} {/* Vulkan for AMD GPU/ APU and Intel Arc GPU */}
{!isMac && experimentalEnabled && ( {!isMac && gpuList.length > 0 && experimentalEnabled && (
<div className="flex w-full flex-col items-start justify-between gap-4 border-b border-[hsla(var(--app-border))] py-4 first:pt-0 last:border-none sm:flex-row"> <div className="flex w-full flex-col items-start justify-between gap-4 border-b border-[hsla(var(--app-border))] py-4 first:pt-0 last:border-none sm:flex-row">
<div className="space-y-1"> <div className="space-y-1">
<div className="flex gap-x-2"> <div className="flex gap-x-2">

6
web/types/file.d.ts vendored Normal file
View File

@ -0,0 +1,6 @@
export type FileType = 'image' | 'pdf'
export type FileInfo = {
file: File
type: FileType
}

View File

@ -13,10 +13,10 @@ import {
} from '@janhq/core' } from '@janhq/core'
import { ulid } from 'ulidx' import { ulid } from 'ulidx'
import { FileType } from '@/containers/Providers/Jotai'
import { Stack } from '@/utils/Stack' import { Stack } from '@/utils/Stack'
import { FileType } from '@/types/file'
export class MessageRequestBuilder { export class MessageRequestBuilder {
msgId: string msgId: string
type: MessageRequestType type: MessageRequestType

View File

@ -6,10 +6,10 @@ import {
ThreadMessage, ThreadMessage,
} from '@janhq/core' } from '@janhq/core'
import { FileInfo } from '@/containers/Providers/Jotai'
import { MessageRequestBuilder } from './messageRequestBuilder' import { MessageRequestBuilder } from './messageRequestBuilder'
import { FileInfo } from '@/types/file'
export class ThreadMessageBuilder { export class ThreadMessageBuilder {
messageRequest: MessageRequestBuilder messageRequest: MessageRequestBuilder