mirror of
https://github.com/webrecorder/pywb.git
synced 2025-03-15 00:03:28 +01:00
vue ui bug fix: duplicate snapshots of same timestamp should be de-duped; was causing a bug as code was assuming de-duped snapshots from server
This commit is contained in:
parent
46cc04bafd
commit
718112884f
File diff suppressed because one or more lines are too long
@ -46,14 +46,20 @@ export function PywbData(rawSnaps) {
|
||||
single = new PywbPeriod({type: PywbPeriod.Type.snapshot, id: snap.id});
|
||||
hour.addChild(single);
|
||||
}
|
||||
single.setSnapshot(snap);
|
||||
if (lastSingle) {
|
||||
lastSingle.setNextSnapshotPeriod(single);
|
||||
single.setPreviousSnapshotPeriod(lastSingle);
|
||||
}
|
||||
lastSingle = single;
|
||||
|
||||
snapshots.push(snap);
|
||||
// De-duplicate single snapshots (sometimes there are multiple snapshots
|
||||
// of the same timestamp with different HTTP status; ignore all
|
||||
// duplicates and take the first entry regardless of status)
|
||||
if (!lastSingle || lastSingle.id !== single.id) {
|
||||
single.setSnapshot(snap);
|
||||
if (lastSingle) {
|
||||
lastSingle.setNextSnapshotPeriod(single);
|
||||
single.setPreviousSnapshotPeriod(lastSingle);
|
||||
}
|
||||
lastSingle = single;
|
||||
|
||||
snapshots.push(snap);
|
||||
}
|
||||
|
||||
// At end of snapshot loop, check period of each type: year/month/day/hour
|
||||
// as all snapshots are now added to the period hierarchy
|
||||
|
Loading…
x
Reference in New Issue
Block a user