Skip to content

Commit

Permalink
return result from clear
Browse files Browse the repository at this point in the history
  • Loading branch information
mafintosh committed Jan 6, 2025
1 parent d452e95 commit 895662d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -432,9 +432,9 @@ module.exports = class HypercoreBlobServer {
if (core === null) return

if (blob) {
await core.clear(blob.blockOffset, blob.blockOffset + blob.blockLength)
const cleared = await core.clear(blob.blockOffset, blob.blockOffset + blob.blockLength)
await core.close()
return
return cleared
}

let result = null
Expand All @@ -444,7 +444,7 @@ module.exports = class HypercoreBlobServer {

await core.close()

if (result !== null) await this.clear(result.key, { blob: result.blob, drive: key, filename, version })
if (result !== null) return this.clear(result.key, { blob: result.blob, drive: key, filename, version })
}
}

Expand Down

0 comments on commit 895662d

Please sign in to comment.