Browse Source

fix: update dependencies and improve app detail handling (#14444)

tags/1.0.0
Wu Tianwei 8 months ago
parent
commit
4fbe52da40
No account linked to committer's email address

+ 3
- 3
web/app/(commonLayout)/app/(appDetailLayout)/[appId]/layout.tsx View File

}, },
] ]
return navs return navs
}, [t])
}, [])


useEffect(() => { useEffect(() => {
if (appDetail) { if (appDetail) {
}).finally(() => { }).finally(() => {
setIsLoadingAppDetail(false) setIsLoadingAppDetail(false)
}) })
}, [appId, router, setAppDetail])
}, [appId, pathname])


useEffect(() => { useEffect(() => {
if (!appDetailRes || isLoadingCurrentWorkspace || isLoadingAppDetail) if (!appDetailRes || isLoadingCurrentWorkspace || isLoadingAppDetail)
} }
} }
// eslint-disable-next-line react-hooks/exhaustive-deps // eslint-disable-next-line react-hooks/exhaustive-deps
}, [appDetailRes, appId, getNavigations, isCurrentWorkspaceEditor, isLoadingAppDetail, isLoadingCurrentWorkspace, router, setAppDetail, systemFeatures.enable_web_sso_switch_component])
}, [appDetailRes, isCurrentWorkspaceEditor, isLoadingAppDetail, isLoadingCurrentWorkspace, systemFeatures.enable_web_sso_switch_component])


useUnmount(() => { useUnmount(() => {
setAppDetail() setAppDetail()

+ 2
- 2
web/app/components/app-sidebar/navLink.tsx View File

import { useSelectedLayoutSegment } from 'next/navigation' import { useSelectedLayoutSegment } from 'next/navigation'
import Link from 'next/link' import Link from 'next/link'
import classNames from '@/utils/classnames' import classNames from '@/utils/classnames'
import type { RemixiconComponentType } from '@remixicon/react'


export type NavIcon = React.ComponentType< export type NavIcon = React.ComponentType<
React.PropsWithoutRef<React.ComponentProps<'svg'>> & { React.PropsWithoutRef<React.ComponentProps<'svg'>> & {
title?: string | undefined title?: string | undefined
titleId?: string | undefined titleId?: string | undefined
}
>
}> | RemixiconComponentType


export type NavLinkProps = { export type NavLinkProps = {
name: string name: string

+ 1
- 1
web/app/components/app/configuration/index.tsx View File

}))) })))
const { data: fileUploadConfigResponse } = useSWR({ url: '/files/upload' }, fetchFileUploadConfig) const { data: fileUploadConfigResponse } = useSWR({ url: '/files/upload' }, fetchFileUploadConfig)


const latestPublishedAt = useMemo(() => appDetail?.model_config.updated_at, [appDetail])
const latestPublishedAt = useMemo(() => appDetail?.model_config?.updated_at, [appDetail])
const [formattingChanged, setFormattingChanged] = useState(false) const [formattingChanged, setFormattingChanged] = useState(false)
const { setShowAccountSettingModal } = useModalContext() const { setShowAccountSettingModal } = useModalContext()
const [hasFetchedDetail, setHasFetchedDetail] = useState(false) const [hasFetchedDetail, setHasFetchedDetail] = useState(false)

+ 2
- 2
web/app/components/app/create-app-dialog/app-list/index.tsx View File

icon_background, icon_background,
description, description,
}) => { }) => {
const { export_data } = await fetchAppDetail(
const { export_data, mode } = await fetchAppDetail(
currApp?.app.id as string, currApp?.app.id as string,
) )
try { try {
if (app.app_id) if (app.app_id)
await handleCheckPluginDependencies(app.app_id) await handleCheckPluginDependencies(app.app_id)
localStorage.setItem(NEED_REFRESH_APP_LIST_KEY, '1') localStorage.setItem(NEED_REFRESH_APP_LIST_KEY, '1')
getRedirection(isCurrentWorkspaceEditor, { id: app.app_id }, push)
getRedirection(isCurrentWorkspaceEditor, { id: app.app_id, mode }, push)
} }
catch (e) { catch (e) {
Toast.notify({ type: 'error', message: t('app.newApp.appCreateFailed') }) Toast.notify({ type: 'error', message: t('app.newApp.appCreateFailed') })

+ 2
- 2
web/app/components/explore/app-list/index.tsx View File

icon_background, icon_background,
description, description,
}) => { }) => {
const { export_data } = await fetchAppDetail(
const { export_data, mode } = await fetchAppDetail(
currApp?.app.id as string, currApp?.app.id as string,
) )
try { try {
if (app.app_id) if (app.app_id)
await handleCheckPluginDependencies(app.app_id) await handleCheckPluginDependencies(app.app_id)
localStorage.setItem(NEED_REFRESH_APP_LIST_KEY, '1') localStorage.setItem(NEED_REFRESH_APP_LIST_KEY, '1')
getRedirection(isCurrentWorkspaceEditor, { id: app.app_id }, push)
getRedirection(isCurrentWorkspaceEditor, { id: app.app_id, mode }, push)
} }
catch (e) { catch (e) {
Toast.notify({ type: 'error', message: t('app.newApp.appCreateFailed') }) Toast.notify({ type: 'error', message: t('app.newApp.appCreateFailed') })

Loading…
Cancel
Save