diff --git a/src/react/components/pages/homepage/homePage.tsx b/src/react/components/pages/homepage/homePage.tsx index a4ed8c9b..fbc81706 100644 --- a/src/react/components/pages/homepage/homePage.tsx +++ b/src/react/components/pages/homepage/homePage.tsx @@ -156,9 +156,15 @@ export default class HomePage extends React.Component { - const loadedProject = await this.props.actions.loadProject(project, sharedToken); - if (loadedProject !== null) { - this.props.history.push(`/projects/${project.id}/edit`); + try { + const loadedProject = await this.props.actions.loadProject(project, sharedToken); + if (loadedProject !== null) { + this.props.history.push(`/projects/${project.id}/edit`); + } + } catch (error) { + if (error instanceof AppError && error.errorCode === ErrorCode.SecurityTokenNotFound) { + toast.error(strings.errors.securityTokenNotFound.message, { autoClose: 5000 }); + } } } @@ -168,7 +174,8 @@ export default class HomePage extends React.Component securityToken.name === project.securityToken); if (!projectToken) { - throw new AppError(ErrorCode.SecurityTokenNotFound, "Security Token Not Found"); + toast.error(strings.errors.securityTokenNotFound.message, { autoClose: 3000 }); + return; } // Load project from storage provider to keep the project in latest state