Commit c94fdf61 authored by Matteo Campanelli's avatar Matteo Campanelli
Browse files

Fixed bug of shipping reloading

parent b61c1ea9
......@@ -99,7 +99,7 @@ function loadEvaluatorPage() {
);
}
function reloadAll() {
function reloadAll(isFirstReload) {
// this is the evaluator page if there is no #userid element
if ( ! $("#userid").length ) {
......@@ -115,18 +115,17 @@ function reloadAll() {
rslt = JSON.parse(rslt);
if (rslt.length == 0) { return "<p>I have no items at the moment</p>"; }
rslt = JSON.parse(rslt);
const mappedVals = rslt.map(showItemInfo);
return "<ul>" + mappedVals.join(' ') + "</ul>"; }
);
// Pending items for shipper
if (user_str[0] == 'S') {
if (user_str[0] == 'S' && isFirstReload) {
load_shipper_pending_items(user_str[1]);
}
}
let intervalID = setInterval( reloadAll, 5000);
$(document).ready( reloadAll );
let intervalID = setInterval( function() { reloadAll(false); }, 5000);
$(document).ready( function() {reloadAll(true); } );
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment