gitbutler
gitbutler copied to clipboard
fix: clicking 'Cancel' on new project page does nothing
☕️ Reasoning
- Clicking 'Add new project' immediately adds the new repo to the projects list
- Clicking 'Cancel' on the project setup page redirects to the app root page
- If the projects list contains a project, the root page redirects to the project page. When the project setup is incomplete, the project setup is displayed
🧢 Changes
- To avoid this redirect, clicking cancel now deletes the project
- To keep the
BackButtongeneric, added a callback (currently namedbeforeOnMouseDown) to be executed before the generic implementation of back.
🎫 Affected issues
Fixes: https://github.com/gitbutlerapp/gitbutler/issues/2539
📌 Todos
- Find a better name for
beforeOnMouseDownor replace with a different way to execute the deletion - Is this the correct way to delete a project? In some place
reloadis called only ifdeleteProjectdidn't throw, but in other places it's called anyway.
Thanks, this looks good. Would you mind fixing those lint errors and I'll merge this pr?
Sure, sorry!
@mtsgrd is there any other action required from side before you merge?
Sorry for the delay, no not at all. Let me rebase it and merge!