Not updating Cart after Gift wrap quantity is set to zero and not getting unchecked checkbox

Hi,

I recently added gift wrapping code to cart page, its working fine but issue is after option checked gift wrap product will be added in cart with the amount, if gift warp quantity is set to zero means subtotal value are changing but checked box is getting unchecked until page refresh, if customer placed order, then it reflects as customer marked gift wrap and message for it,

Need a solution for checkbox has to be unchecked when gift wrap product is set zero quantity on cart

{% if linklists.gift-wrapping.links.size > 0 and
linklists.gift-wrapping.links.first.type == 'product_link' %}

  

    
    
  

  

    
  
    
  

{% assign id = linklists.gift-wrapping.links.first.object.variants.first.id
%} {% assign gift_wraps_in_cart = 0 %} {% for item in cart.items %} {% if
item.id == id %} {% assign gift_wraps_in_cart = item.quantity %} {% endif %}
{% endfor %}

{% else %}

  You attempted to add a gift-wrapping script to your shopping cart, but it
  won't work because you don't have a link list with handle
  `gift-wrapping` which, in turn, contains a link to your
  gift-wrapping product. Please review the steps outlined
  [here](https://help.shopify.com/manual/online-store/themes/os/customize/add-gift-wrap-option).

{% endif %}