Commit 2f8f9c1b473fe1fad723c98f70206e024ffe6d42
fix index regeration progress
Dominic Tarr committed on 6/10/2017, 2:05:22 AMParent: 03c9daeb104b3ddf3c69242f7bcf4e5c0e4e24c4
Files changed
db.js | changed |
db.js | ||
---|---|---|
@@ -21,9 +21,9 @@ | ||
21 | 21 | |
22 | 22 | db.progress = {} |
23 | 23 | var prog = db.progress.indexes = {start: 0, current: 0, target: 0} |
24 | 24 | var ts = Date.now() |
25 | - db.since.once(function (v) { prog.start = v }) | |
25 | + | |
26 | 26 | db.since(function () { |
27 | 27 | prog.target = db.since.value |
28 | 28 | if(Date.now() > ts + 100) |
29 | 29 | update() |
@@ -41,14 +41,19 @@ | ||
41 | 41 | } |
42 | 42 | prog.current = ~~(current / n) |
43 | 43 | //if the progress bar is complete, move the starting point |
44 | 44 | //up to the current position! |
45 | - if(prog.current === prog.target) | |
45 | + if(prog.start <= 0) | |
46 | 46 | prog.start = prog.current |
47 | + else if(prog.current == prog.target) | |
48 | + prog.start = prog.target | |
49 | + | |
47 | 50 | } |
48 | 51 | |
49 | 52 | setInterval(update, 200).unref() |
50 | 53 | |
51 | 54 | return db |
52 | 55 | } |
53 | 56 | |
54 | 57 | |
58 | + | |
59 | + |
Built with git-ssb-web