The all-in-one local AI studio for your desktop: chat, image and video generation and a coding agent in one free, open source app. Windows and Linux. No Docker, no terminal, no cloud required.
TypeScript agentai-chatai-studioall-in-onecoding-agentdesktop-appfluximage-generationlinuxllmlocal-ailocal-llmopen-sourceprivacyself-hostedstable-diffusionuncensoreduncensored-aivideo-generationwindows
import { useSyncExternalStore } from 'react'
import { useChatStore } from '../../../../stores/chatStore'
function subscribeHydration(notify: () => void): () => void {
try {
return useChatStore.persist.onFinishHydration(notify)
} catch {
return () => {}
}
}
function hasHydrated(): boolean {
try {
return useChatStore.persist.hasHydrated()
} catch {
return true
}
}
/** False until the chats were read from storage. Until then a list is "loading", not "empty". */
export function useChatsHydrated(): boolean {
return useSyncExternalStore(subscribeHydration, hasHydrated, () => true)
}