feat: app icon enhancements (#7095)

This commit is contained in:
Hash Brown 2024-08-08 15:29:11 +08:00 • committed by GitHub
commit b6d206e095
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 46 additions and 13 deletions

View file

@ -37,11 +37,14 @@ import type {
import { addFileInfos, sortAgentSorts } from '@/app/components/tools/utils'
import { useToastContext } from '@/app/components/base/toast'
import { changeLanguage } from '@/i18n/i18next-config'
import { useAppFavicon } from '@/hooks/use-app-favicon'
export const useChatWithHistory = (installedAppInfo?: InstalledApp) => {
const isInstalledApp = useMemo(() => !!installedAppInfo, [installedAppInfo])
const { data: appInfo, isLoading: appInfoLoading, error: appInfoError } = useSWR(installedAppInfo ? null : 'appInfo', fetchAppInfo)
useAppFavicon(!installedAppInfo, appInfo?.site.icon, appInfo?.site.icon_background)
const appData = useMemo(() => {
if (isInstalledApp) {
const { id, app } = installedAppInfo!