app-redirection.ts 409 B

123456789101112131415
  1. export const getRedirection = (
  2. isCurrentWorkspaceEditor: boolean,
  3. app: any,
  4. redirectionFunc: (href: string) => void,
  5. ) => {
  6. if (!isCurrentWorkspaceEditor) {
  7. redirectionFunc(`/app/${app.id}/overview`)
  8. }
  9. else {
  10. if (app.mode === 'workflow' || app.mode === 'advanced-chat')
  11. redirectionFunc(`/app/${app.id}/workflow`)
  12. else
  13. redirectionFunc(`/app/${app.id}/configuration`)
  14. }
  15. }