Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Conversation

Comnir
Copy link
Contributor

@Comnir Comnir commented Aug 10, 2024

☕️ 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: #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.

- Fixes gitbutlerapp#2539
- Clicking 'Add new project' immediately adds the the repo to the projects list
- Clicking Cancel on the project setup pageredirects to the app root page
- If the projects list conatins a project, the root page redirects to the project page. When the project setup is incomplete, the project setup is displayed
- To avoid this redirect, clicking cancel now deletes the project
@krlvi krlvi requested a review from mtsgrd August 13, 2024 09:54
@Comnir Comnir requested a review from mtsgrd August 14, 2024 16:55
@mtsgrd
Copy link
Contributor

mtsgrd commented Aug 15, 2024

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

@Comnir
Copy link
Contributor Author

Comnir commented Aug 15, 2024

Sure, sorry!

@Comnir Comnir marked this pull request as ready for review August 16, 2024 09:04
@Comnir
Copy link
Contributor Author

Comnir commented Aug 20, 2024

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

@mtsgrd
Copy link
Contributor

mtsgrd commented Aug 20, 2024

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

@mtsgrd mtsgrd enabled auto-merge (rebase) August 20, 2024 11:37
auto-merge was automatically disabled August 20, 2024 11:38

Rebase failed

@mtsgrd mtsgrd merged commit c968a10 into gitbutlerapp:master Aug 21, 2024
12 checks passed
@Comnir Comnir deleted the delete-project-when-backing-from-adding-project branch August 23, 2024 12:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't back out of adding new project
2 participants