Skip to content

Commit e930a00

Browse files
committed
Change status support
1 parent 3b82a1b commit e930a00

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

WooCommerce/Classes/ViewRelated/Orders/Order Creation/Synchronizer/LocalOrderSynchronizer.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ final class LocalOrderSynchronizer: OrderSynchronizer {
4343
init(siteID: Int64, stores: StoresManager = ServiceLocator.stores) {
4444
self.siteID = siteID
4545
self.stores = stores
46+
bindInputs()
4647
}
4748

4849
// MARK: Methods
@@ -55,3 +56,13 @@ final class LocalOrderSynchronizer: OrderSynchronizer {
5556
stores.dispatch(action)
5657
}
5758
}
59+
60+
private extension LocalOrderSynchronizer {
61+
func bindInputs() {
62+
setStatus.withLatestFrom(orderPublisher)
63+
.map { newStatus, order in
64+
order.copy(status: newStatus)
65+
}
66+
.assign(to: &$order)
67+
}
68+
}

0 commit comments

Comments
 (0)