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

[Order Editing] Cancelling an order edit in split view with unsynced changes doesn't request confirmation. #14962

Open
joshheald opened this issue Jan 23, 2025 · 1 comment
Labels
feature: order creation All tasks related to creating an order priority: low Not many people are affected or there’s a workaround, etc. type: bug A confirmed bug.

Comments

@joshheald
Copy link
Contributor

joshheald commented Jan 23, 2025

          There are no issues with this logic but it revealed an issue with `canBeDismissed: Bool` when testing.
    var canBeDismissed: Bool {
        switch flow {
        case .creation: // Creation can be dismissed when there aren't changes pending to commit.
            return !hasChanges
        case .editing: // Editing can always be dismissed because changes are committed instantly.
            return true
        }
    }

When we edit on an iPad, then if we make changes in a product picker and click dismiss, we don't show an alert.

I think it should be:

    var canBeDismissed: Bool {
        switch flow {
        case .creation: // Creation can be dismissed when there aren't changes pending to commit.
            return !hasChanges
        case .editing: // Editing can always be dismissed on iPhone because changes are committed instantly.
            return !(selectionSyncApproach == .onRecalculateButtonTap && hasChanges)
        }
    }

Originally posted by @staskus in #14907 (comment)

Agreed... however I've just had a go at fixing that, and opens a can of worms which I don't want to dive in to right now.

  1. If you change it as suggested, discarding the changes during editing deletes the order.
  2. If you prevent the deletion, making an edit, tapping cancel, then continuing with the edit instead of discarding it breaks the Recalculate button (and I have no idea why...)

To get most of the fix out, I'm going to log this as a separate issue... but it'll be pretty low priority, I think.

@dangermattic
Copy link
Collaborator

dangermattic commented Jan 23, 2025

Thanks for reporting! 👍

@joshheald joshheald added type: bug A confirmed bug. priority: low Not many people are affected or there’s a workaround, etc. feature: order creation All tasks related to creating an order labels Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature: order creation All tasks related to creating an order priority: low Not many people are affected or there’s a workaround, etc. type: bug A confirmed bug.
Projects
None yet
Development

No branches or pull requests

2 participants