client/posts: wrap with big progress

fixes #114
This commit is contained in:
rr-
2017-01-08 22:24:46 +01:00
parent e5f08b454c
commit 43198daba3
3 changed files with 35 additions and 5 deletions

View 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,
};