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

@ -36,6 +36,7 @@ import { DEFAULT_VALUE_MAX_LEN, appDefaultIconBackground } from '@/config'
import Toast from '@/app/components/base/toast'
import type { VisionFile, VisionSettings } from '@/types/app'
import { Resolution, TransferMethod } from '@/types/app'
import { useAppFavicon } from '@/hooks/use-app-favicon'
const GROUP_SIZE = 5 // to avoid RPM(Request per minute) limit. The group task finished then the next group.
enum TaskStatus {
@ -363,6 +364,8 @@ const TextGeneration: FC<IMainProps> = ({
title: installedAppInfo?.app.name,
prompt_public: false,
copyright: '',
icon: installedAppInfo?.app.icon,
icon_background: installedAppInfo?.app.icon_background,
},
plan: 'basic',
}
@ -408,6 +411,8 @@ const TextGeneration: FC<IMainProps> = ({
}
}, [siteInfo?.title, canReplaceLogo])
useAppFavicon(!isInstalledApp, siteInfo?.icon, siteInfo?.icon_background)
const [isShowResSidebar, { setTrue: doShowResSidebar, setFalse: hideResSidebar }] = useBoolean(false)
const showResSidebar = () => {
// fix: useClickAway hideResSidebar will close sidebar