Backup state stays valid JSON with a name that is not UTF-8; Bin reads on from an id, not a position
This commit is contained in:
+1
-1
@@ -21,7 +21,7 @@ export default {
|
||||
addSlot: (passphrase, label) => call('post', '/key/slots', { passphrase, label }),
|
||||
replaceSlot: (slot, passphrase, label) => call('put', `/key/slots/${slot}`, { passphrase, label }),
|
||||
removeSlot: (slot) => call('delete', `/key/slots/${slot}`),
|
||||
trash: (targetId, offset = 0) => call('get', `/targets/${targetId}/trash`, { offset }),
|
||||
trash: (targetId, after = '') => call('get', `/targets/${targetId}/trash`, { after }),
|
||||
untrash: (targetId, snapshotId) => call('post', `/targets/${targetId}/trash/${snapshotId}`),
|
||||
kitUrl: () => url('/key/kit'),
|
||||
confirmKit: (accepted, phrase, code) => call('post', '/key/confirm', { accepted, phrase, code }),
|
||||
|
||||
@@ -78,13 +78,13 @@ async function loadTarget(target, load) {
|
||||
reading.value = { name: target.name, total: null, done: 0 }
|
||||
const items = []
|
||||
for (;;) {
|
||||
const page = await api.trash(target.id, items.length)
|
||||
const page = await api.trash(target.id, items.length ? items[items.length - 1].id : '')
|
||||
if (load !== current) {
|
||||
return
|
||||
}
|
||||
items.push(...page.items)
|
||||
reading.value = { name: target.name, total: page.total, done: Math.min(items.length, page.total) }
|
||||
if (items.length >= page.total || !page.items.length) {
|
||||
if (!page.items.length || items.length >= page.total) {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user