vue-storefront icon indicating copy to clipboard operation
vue-storefront copied to clipboard

[Bug]: useUserShippingFactory is passing initial shipping value to composables

Open sabasayer opened this issue 4 years ago • 0 comments
trafficstars

Describe the Bug

useUserShippingFactory is passing readonlyShipping variables which is unref(shipping).

shipping variable is reactive, but readonlyShipping is not a computedProp so when any kind of changes happens at the shipping it will not effect the readonlyShipping. It's value will be the initial value.

This causes some errors.

Current behavior

variable for shipping that passed to composable methods is readOnlyShipping and it is not reactive. It's not changing when shipping changed. In my case shipping is an array of addresses.

image

Expected behavior

readonlyShipping variable must be computedProp or shipping must be passed with unref when the methods are called. addAddress , deleteAddress, updateAddress is using this variable.

Steps to reproduce

No response

What version of Vue Storefront are you using?

2.4.4

What version of Node.js are you using?

14.18.1

What browser (and version) are you using?

Chrome latest

What operating system (and version) are you using?

macOs

Relevant log output

No response

Able to fix / change the documentation?

  • [ ] Yes
  • [ ] No

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

sabasayer avatar Oct 28 '21 12:10 sabasayer