Skip to content
Browse files

Added page refresh when product becomes available.

  • Loading branch information...
1 parent 258603e commit 0b59f44488d01b901fc350af448647c0f2a8ef4a @mud committed
Showing with 7 additions and 2 deletions.
  1. +7 −2 app/assets/javascripts/store/spree_timed_order.js.erb
View
9 app/assets/javascripts/store/spree_timed_order.js.erb
@@ -32,8 +32,13 @@
var $availableContainer = $('#product-available-at');
var availableTimer = window.setInterval(function() {
var l = timeLeftInWords(availableAt);
- if (l == "Expired")
- l = "Refresh to check availability";
+ if (l == "Expired") {
+ window.clearInterval(availableTimer);
+ l = "Refreshing...";
+ window.setTimeout(function() {
+ window.location.reload(true);
+ }, 2000);
+ }
$availableContainer.text(l);
}, 100);
}

0 comments on commit 0b59f44

Please sign in to comment.
Something went wrong with that request. Please try again.