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:
Chris 2026-04-13 20:32:57 +03:00 committed by GitHub
parent 34dc0373fb
commit e2d0b4d228
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 2 deletions

View file

@ -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);

View file

@ -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'