gitbutler icon indicating copy to clipboard operation
gitbutler copied to clipboard

fix: clicking 'Cancel' on new project page does nothing

Open Comnir opened this issue 1 year ago • 2 comments

☕️ 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 BackButton generic, added a callback (currently named beforeOnMouseDown) 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 beforeOnMouseDown or replace with a different way to execute the deletion
  • Is this the correct way to delete a project? In some place reload is called only if deleteProject didn't throw, but in other places it's called anyway.

Comnir avatar Aug 10 '24 17:08 Comnir

Thanks, this looks good. Would you mind fixing those lint errors and I'll merge this pr?

mtsgrd avatar Aug 15 '24 14:08 mtsgrd

Sure, sorry!

Comnir avatar Aug 15 '24 17:08 Comnir

@mtsgrd is there any other action required from side before you merge?

Comnir avatar Aug 20 '24 06:08 Comnir

Sorry for the delay, no not at all. Let me rebase it and merge!

mtsgrd avatar Aug 20 '24 11:08 mtsgrd