Why is my free shipping countdown script glitchy on my Impulse theme cart page?

Ive added a script, to my site to the cart page to countdown for free shipping - free shipping on orders over £50 for UK

:delivery_truck: Congrats! You’ve got free shipping within the UK!

It seems to be glitchy though - can anyone work out why? It seems to only work if you refresh your browser

Code I have used is - theme is IMPULSE

I added this to my snippet ,

cart-drawer.liquid

{%- if settings.cart_type == 'drawer' -%}
  
    
  

{%- endif -%}

And

main-cart.liquid (section)


  {%- render 'breadcrumbs' -%}

  

  
{% assign shipping_value = 5000 %}
{% assign cart_total = cart.total_price %}
{% assign shipping_value_left = shipping_value | minus: cart_total %}

{% if shipping_value_left > 0 %}
 You are {{ shipping_value_left | money }} away from FREE shipping within the UK!

  {% else %}
 Congrats! You've got free shipping within the UK!
  {% endif %}

  
  
  {%- if cart.item_count > 0 -%}
    
  {%- endif -%}

{% schema %}
  {
    "name": "Cart page"
  }
{% endschema %}