Skip to content

Commit

Permalink
Adjusted spinner calls, and colour
Browse files Browse the repository at this point in the history
  • Loading branch information
Mattk70 committed Nov 18, 2023
1 parent 8d63b94 commit f20fd0d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ body {
width: 5rem;
height: 5rem;
border-width: .8rem;
color: #212529;
color: #520000;
}

@font-face {
Expand Down
4 changes: 3 additions & 1 deletion js/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -1029,7 +1029,6 @@ exploreLink.addEventListener('click', async () => {
showElement(['exploreWrapper', 'spectrogramWrapper'], false);
enableMenuItem(['saveCSV']);
adjustSpecDims(true)
showLoadingSpinner();
worker.postMessage({ action: 'filter', species: undefined, range: STATE.explore.range, explore: true }); // re-prepare
});

Expand Down Expand Up @@ -1551,6 +1550,9 @@ const setUpWorkerMessaging = () => {
case 'seen-species-list':
generateBirdList('seenSpecies', args.list);
break;
case 'show-spinner':
showLoadingSpinner();
break;
case 'spawning':
displayWarmUpMessage();
break;
Expand Down
6 changes: 4 additions & 2 deletions js/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -268,9 +268,10 @@ async function handleMessage(e) {
case 'filter':
if (STATE.db) {
t0 = Date.now()
UI.postMessage({event: 'show-spinner'});
await Promise.all([getSummary(args), getResults(args)]);
UI.postMessage({event: 'hide-spinner'});
if (DEBUG) console.log('Filter took ', (Date.now() - t0) / 1000, 'seconds')

}
break;
case 'get-detected-species-list':
Expand Down Expand Up @@ -333,6 +334,7 @@ async function handleMessage(e) {
await onUpdateFileStart(args)
break;
case 'update-list':
UI.postMessage({event: 'show-spinner'});
SEEN_LIST_UPDATE = false;
predictWorkers.forEach(worker =>
worker.postMessage({ message: 'list', list: args.list }))
Expand Down Expand Up @@ -2175,7 +2177,7 @@ const getResults = async ({
}
}
}

UI.postMessage({event: 'hide-spinner'});
};

// Function to format the CSV export
Expand Down

0 comments on commit f20fd0d

Please sign in to comment.