Skip to content

Commit

Permalink
fix results page error when dataset was being created; do not check f…
Browse files Browse the repository at this point in the history
…or resultspage updates when user not focused on page
  • Loading branch information
dale-wahl committed Apr 15, 2024
1 parent db05ae5 commit 3ec9c6e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions webtool/static/js/fourcat.js
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,11 @@ const query = {
},

check_resultpage: function () {
if (!document.hasFocus()) {
//don't hammer the server while user is looking at something else
return;
}

let unfinished = $('.dataset-unfinished');
if (unfinished.length === 0) {
return;
Expand Down
2 changes: 1 addition & 1 deletion webtool/templates/results.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ <h4>{{ dataset.get_label() }}</h4>

<div class="property-container status">
{% if not dataset.is_finished() or dataset.num_rows == 0 %}
<p class="button-like inactive{% if dataset.progress and dataset.progress > 0 and not dataset.is_finished() %} progress progress-{{ (dataset.progress * 100)|round(0)|int }}{% endif %}"><span class="dataset-status">{% include "components/result-status.html" %}</span></p>
<p class="button-like inactive{% if dataset.progress and dataset.progress > 0 and not dataset.is_finished() %} progress progress-{{ (dataset.progress * 100)|round(0)|int }}{% endif %}"><span class="dataset-status"><span class="result-status">{% include "components/result-status.html" %}</span></span></p>
{% else %}
<a class="button-like" href="{{ url_for('get_result', query_file=dataset.result_file) }}"><i class="fas fa-download" aria-hidden="true"></i> {{ dataset.get_results_path()|filesize }}, {{ dataset.result_file.split(".")[-1] }}</a>
{% endif %}
Expand Down

0 comments on commit 3ec9c6e

Please sign in to comment.