mirror of
https://github.com/logos-storage/ethcc-demo.git
synced 2026-01-23 15:33:07 +00:00
fix StorageFinished appearing immediately after StorageRequested
This commit is contained in:
parent
d01b188f76
commit
903272e16a
@ -127,8 +127,8 @@ export const useRequestsStore = defineStore(
|
||||
try {
|
||||
// set request state to finished at the end of the request -- there's no
|
||||
// other way to know when a request finishes
|
||||
let { requestedAt, endsAt } = timestampsFor(ask, expiry, timestamp)
|
||||
let msFromNow = endsAt - Date.now() // time remaining until finish, in ms
|
||||
let { endsAt } = timestampsFor(ask, expiry, timestamp)
|
||||
let msFromNow = endsAt * 1000 - Date.now() // time remaining until finish, in ms
|
||||
requestFinishedId = waitForRequestFinished(
|
||||
requestId,
|
||||
msFromNow,
|
||||
@ -338,7 +338,7 @@ export const useRequestsStore = defineStore(
|
||||
|
||||
marketplace.on(StorageRequested, async (requestId, ask, expiry, event) => {
|
||||
let { blockNumber, blockHash } = event.log
|
||||
const request = addRequest(requestId, ask, expiry, blockHash)
|
||||
const request = await addRequest(requestId, ask, expiry, blockHash)
|
||||
|
||||
// callback
|
||||
if (onStorageRequested) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user