fix: resolve inbox project creation bugs (#1018)
- Fix button text showing "Update Project" instead of "Create Project" by checking for project.uid/id instead of just project existence - Remove duplicate success toast (ProjectModal already shows one) - Update both local and global projects store after creation so new project appears in Projects view without refresh Fixes #980
This commit is contained in:
parent
34dc0373fb
commit
e2d0b4d228
2 changed files with 7 additions and 2 deletions
|
|
@ -328,7 +328,12 @@ const InboxItems: React.FC = () => {
|
|||
const handleSaveProject = async (project: Project) => {
|
||||
try {
|
||||
await createProject(project);
|
||||
showSuccessToast(t('project.createSuccess'));
|
||||
|
||||
const updatedProjects = await fetchProjects();
|
||||
setProjects(updatedProjects);
|
||||
|
||||
const { setProjects: setGlobalProjects } = useStore.getState().projectsStore;
|
||||
setGlobalProjects(updatedProjects);
|
||||
|
||||
if (currentConversionItemUid !== null) {
|
||||
await handleProcessItem(currentConversionItemUid, false);
|
||||
|
|
|
|||
|
|
@ -801,7 +801,7 @@ const ProjectModal: React.FC<ProjectModalProps> = ({
|
|||
className="px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 dark:bg-blue-500 dark:hover:bg-blue-600 focus:outline-none transition duration-150 ease-in-out text-sm"
|
||||
data-testid="project-save-button"
|
||||
>
|
||||
{project
|
||||
{project?.uid || project?.id
|
||||
? t(
|
||||
'modals.updateProject',
|
||||
'Update Project'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue