Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dify
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ai-tech
dify
Commits
fca97531
Commit
fca97531
authored
Mar 06, 2024
by
JzoNg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix app detail update
parent
0529c3d5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
8 deletions
+11
-8
layout.tsx
...p/(commonLayout)/app/(appDetailLayout)/[appId]/layout.tsx
+11
-8
No files found.
web/app/(commonLayout)/app/(appDetailLayout)/[appId]/layout.tsx
View file @
fca97531
...
@@ -27,8 +27,8 @@ const AppDetailLayout: FC<IAppDetailLayoutProps> = (props) => {
...
@@ -27,8 +27,8 @@ const AppDetailLayout: FC<IAppDetailLayoutProps> = (props) => {
const
router
=
useRouter
()
const
router
=
useRouter
()
const
pathname
=
usePathname
()
const
pathname
=
usePathname
()
const
{
isCurrentWorkspaceManager
}
=
useAppContext
()
const
{
isCurrentWorkspaceManager
}
=
useAppContext
()
const
detailParams
=
{
url
:
'/apps'
,
id
:
appId
}
const
{
appDetail
,
setAppDetail
}
=
useStore
()
const
{
appDetail
,
setAppDetail
}
=
useStore
()
const
detailParams
=
{
url
:
'/apps'
,
id
:
appId
}
const
{
data
:
response
}
=
useSWR
(
detailParams
,
fetchAppDetail
)
const
{
data
:
response
}
=
useSWR
(
detailParams
,
fetchAppDetail
)
const
navigation
=
useMemo
(()
=>
{
const
navigation
=
useMemo
(()
=>
{
...
@@ -67,24 +67,27 @@ const AppDetailLayout: FC<IAppDetailLayoutProps> = (props) => {
...
@@ -67,24 +67,27 @@ const AppDetailLayout: FC<IAppDetailLayoutProps> = (props) => {
},
[
appId
,
isCurrentWorkspaceManager
,
response
?.
mode
,
t
])
},
[
appId
,
isCurrentWorkspaceManager
,
response
?.
mode
,
t
])
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
response
?.
name
)
if
(
response
&&
!
appDetail
)
document
.
title
=
`
${(
response
.
name
||
'App'
)}
- Dify`
if
(
response
&&
response
!==
appDetail
)
setAppDetail
(
response
)
setAppDetail
(
response
)
},
[
appDetail
,
response
,
setAppDetail
])
},
[
appDetail
,
response
,
setAppDetail
])
if
(
!
response
)
useEffect
(()
=>
{
if
(
appDetail
?.
name
)
document
.
title
=
`
${(
appDetail
.
name
||
'App'
)}
- Dify`
},
[
appDetail
])
if
(
!
appDetail
)
return
null
return
null
// redirections
// redirections
if
(
response
&&
(
response
?.
mode
===
'workflow'
||
response
?
.
mode
===
'advanced-chat'
)
&&
(
pathname
).
endsWith
(
'configuration'
))
if
(
(
appDetail
.
mode
===
'workflow'
||
appDetail
.
mode
===
'advanced-chat'
)
&&
(
pathname
).
endsWith
(
'configuration'
))
router
.
replace
(
`/app/
${
appId
}
/workflow`
)
router
.
replace
(
`/app/
${
appId
}
/workflow`
)
if
(
response
&&
(
response
?.
mode
!==
'workflow'
&&
response
?
.
mode
!==
'advanced-chat'
)
&&
(
pathname
).
endsWith
(
'workflow'
))
if
(
(
appDetail
.
mode
!==
'workflow'
&&
appDetail
.
mode
!==
'advanced-chat'
)
&&
(
pathname
).
endsWith
(
'workflow'
))
router
.
replace
(
`/app/
${
appId
}
/configuration`
)
router
.
replace
(
`/app/
${
appId
}
/configuration`
)
return
(
return
(
<
div
className=
{
cn
(
s
.
app
,
'flex'
,
'overflow-hidden'
)
}
>
<
div
className=
{
cn
(
s
.
app
,
'flex'
,
'overflow-hidden'
)
}
>
<
AppSideBar
title=
{
response
.
name
}
icon=
{
response
.
icon
}
icon_background=
{
response
.
icon_background
}
desc=
{
response
.
mode
}
navigation=
{
navigation
}
/>
<
AppSideBar
title=
{
appDetail
.
name
}
icon=
{
appDetail
.
icon
}
icon_background=
{
appDetail
.
icon_background
}
desc=
{
appDetail
.
mode
}
navigation=
{
navigation
}
/>
<
div
className=
"bg-white grow overflow-hidden"
>
<
div
className=
"bg-white grow overflow-hidden"
>
{
children
}
{
children
}
</
div
>
</
div
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment