{% extends "templates/stop_pending.html" %}
{% from "_macros.html" import swan_loader with context %}

{% block main %}
<div class="container">
  <div class="row">
    {% call swan_loader() %}
      <div class="text-center">
        <h4>Stopping your session...</h4>
        <p>You will be able to start it again once it has finished stopping.</p>
        <p>If this is taking too long, <a id="refresh" href="#">click here to refresh</a>.</p>
      </div>
    {% endcall %}
  </div>
</div>
{% endblock %}

{% block script %}
{{ super() }}
<script type="text/javascript">

const refreshBtn = document.getElementById("refresh");

refreshBtn.addEventListener("click", e => {
  e.preventDefault();
  window.location.reload();
});

setTimeout(() => {
  window.location.reload();
}, 5000);

</script>
{% endblock %}
