Skip to content

Commit

Permalink
fix: update dependencies and improve app detail handling (#14444)
Browse files Browse the repository at this point in the history
  • Loading branch information
WTW0313 authored Feb 27, 2025
1 parent 1e3197a commit 4fbe52d
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ const AppDetailLayout: FC<IAppDetailLayoutProps> = (props) => {
},
]
return navs
}, [t])
}, [])

useEffect(() => {
if (appDetail) {
Expand All @@ -120,7 +120,7 @@ const AppDetailLayout: FC<IAppDetailLayoutProps> = (props) => {
}).finally(() => {
setIsLoadingAppDetail(false)
})
}, [appId, router, setAppDetail])
}, [appId, pathname])

useEffect(() => {
if (!appDetailRes || isLoadingCurrentWorkspace || isLoadingAppDetail)
Expand Down Expand Up @@ -148,7 +148,7 @@ const AppDetailLayout: FC<IAppDetailLayoutProps> = (props) => {
}
}
// 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(() => {
setAppDetail()
Expand Down
4 changes: 2 additions & 2 deletions web/app/components/app-sidebar/navLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
import { useSelectedLayoutSegment } from 'next/navigation'
import Link from 'next/link'
import classNames from '@/utils/classnames'
import type { RemixiconComponentType } from '@remixicon/react'

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

export type NavLinkProps = {
name: string
Expand Down
2 changes: 1 addition & 1 deletion web/app/components/app/configuration/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ const Configuration: FC = () => {
})))
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 { setShowAccountSettingModal } = useModalContext()
const [hasFetchedDetail, setHasFetchedDetail] = useState(false)
Expand Down
4 changes: 2 additions & 2 deletions web/app/components/app/create-app-dialog/app-list/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ const Apps = ({
icon_background,
description,
}) => {
const { export_data } = await fetchAppDetail(
const { export_data, mode } = await fetchAppDetail(
currApp?.app.id as string,
)
try {
Expand All @@ -151,7 +151,7 @@ const Apps = ({
if (app.app_id)
await handleCheckPluginDependencies(app.app_id)
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) {
Toast.notify({ type: 'error', message: t('app.newApp.appCreateFailed') })
Expand Down
4 changes: 2 additions & 2 deletions web/app/components/explore/app-list/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ const Apps = ({
icon_background,
description,
}) => {
const { export_data } = await fetchAppDetail(
const { export_data, mode } = await fetchAppDetail(
currApp?.app.id as string,
)
try {
Expand All @@ -149,7 +149,7 @@ const Apps = ({
if (app.app_id)
await handleCheckPluginDependencies(app.app_id)
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) {
Toast.notify({ type: 'error', message: t('app.newApp.appCreateFailed') })
Expand Down

0 comments on commit 4fbe52d

Please sign in to comment.