mirror of
https://github.com/rr-/szurubooru.git
synced 2025-07-17 08:26:24 +00:00
24
client/js/util/progress.js
Normal file
24
client/js/util/progress.js
Normal file
@ -0,0 +1,24 @@
|
||||
const nprogress = require('nprogress');
|
||||
|
||||
let nesting = 0;
|
||||
|
||||
function start() {
|
||||
if (!nesting) {
|
||||
nprogress.start();
|
||||
}
|
||||
nesting++;
|
||||
}
|
||||
|
||||
function done() {
|
||||
nesting--;
|
||||
if (nesting > 0) {
|
||||
nprogress.inc();
|
||||
} else {
|
||||
nprogress.done();
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
start: start,
|
||||
done: done,
|
||||
};
|
Reference in New Issue
Block a user