2020-06-06 00:03:37 +02:00
|
|
|
"use strict";
|
2020-06-04 20:09:35 +02:00
|
|
|
|
2020-06-06 00:03:37 +02:00
|
|
|
const nprogress = require("nprogress");
|
2017-01-08 22:24:46 +01:00
|
|
|
|
|
|
|
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,
|
2020-06-04 20:09:35 +02:00
|
|
|
done: done,
|
2017-01-08 22:24:46 +01:00
|
|
|
};
|