fix: quickask mixing color schema (#2979)
This commit is contained in:
parent
1ce15e6bc4
commit
af240bfe75
@ -10,7 +10,6 @@ const SelectedText = ({ onCleared }: { onCleared?: () => void }) => {
|
||||
const containerRef = useRef<HTMLDivElement>(null)
|
||||
|
||||
useEffect(() => {
|
||||
if (window.core?.api?.quickAskSizeUpdated !== 'function') return
|
||||
if (text.trim().length === 0) {
|
||||
window.core?.api?.quickAskSizeUpdated(0)
|
||||
} else {
|
||||
|
||||
@ -2,23 +2,55 @@
|
||||
|
||||
import { useEffect } from 'react'
|
||||
|
||||
import { AppConfiguration, getUserHomePath, joinPath } from '@janhq/core'
|
||||
|
||||
import { useSetAtom } from 'jotai'
|
||||
|
||||
import ClipboardListener from '@/containers/Providers/ClipboardListener'
|
||||
|
||||
import JotaiWrapper from '@/containers/Providers/Jotai'
|
||||
import ThemeWrapper from '@/containers/Providers/Theme'
|
||||
|
||||
import { useLoadTheme } from '@/hooks/useLoadTheme'
|
||||
|
||||
import { setupCoreServices } from '@/services/coreService'
|
||||
|
||||
import Search from './page'
|
||||
|
||||
import { defaultJanDataFolderAtom } from '@/helpers/atoms/App.atom'
|
||||
import { janDataFolderPathAtom } from '@/helpers/atoms/AppConfig.atom'
|
||||
|
||||
export default function RootLayout() {
|
||||
const setJanDataFolderPath = useSetAtom(janDataFolderPathAtom)
|
||||
const setJanDefaultDataFolder = useSetAtom(defaultJanDataFolderAtom)
|
||||
|
||||
useEffect(() => {
|
||||
setupCoreServices()
|
||||
}, [])
|
||||
|
||||
useEffect(() => {
|
||||
window.core?.api
|
||||
?.getAppConfigurations()
|
||||
?.then((appConfig: AppConfiguration) => {
|
||||
setJanDataFolderPath(appConfig.data_folder)
|
||||
})
|
||||
}, [setJanDataFolderPath])
|
||||
|
||||
useEffect(() => {
|
||||
async function getDefaultJanDataFolder() {
|
||||
const homePath = await getUserHomePath()
|
||||
const defaultJanDataFolder = await joinPath([homePath, 'jan'])
|
||||
|
||||
setJanDefaultDataFolder(defaultJanDataFolder)
|
||||
}
|
||||
getDefaultJanDataFolder()
|
||||
}, [setJanDefaultDataFolder])
|
||||
|
||||
useLoadTheme()
|
||||
|
||||
return (
|
||||
<html lang="en" suppressHydrationWarning>
|
||||
<body className="bg-[hsla(var(--app-bg))] font-sans antialiased">
|
||||
<body className="font-sans antialiased">
|
||||
<JotaiWrapper>
|
||||
<ThemeWrapper>
|
||||
<ClipboardListener>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user