Files
dify/web/utils/app-redirection.ts
T

15 lines
409 B
TypeScript
Raw Normal View History

2024-04-08 18:51:46 +08:00
export const getRedirection = (
isCurrentWorkspaceEditor: boolean,
2024-04-08 18:51:46 +08:00
app: any,
redirectionFunc: (href: string) => void,
) => {
if (!isCurrentWorkspaceEditor) {
2024-04-08 18:51:46 +08:00
redirectionFunc(`/app/${app.id}/overview`)
}
else {
if (app.mode === 'workflow' || app.mode === 'advanced-chat')
redirectionFunc(`/app/${app.id}/workflow`)
else
redirectionFunc(`/app/${app.id}/configuration`)
}
}