Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
xzilja committed Dec 15, 2023
1 parent 2628b9b commit 37fb52b
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 8 deletions.
1 change: 0 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions packages/core/src/utils/CoreHelperUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,6 @@ export const CoreHelperUtil = {
})
},

getTimeDifferenceMs(deadlineMs: number) {
return Date.now() - deadlineMs
},

// eslint-disable-next-line @typescript-eslint/no-explicit-any
parseError(error: any): string {
if (typeof error === 'string') {
Expand Down
1 change: 0 additions & 1 deletion packages/wallet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
"lint": "eslint . --ext .js,.jsx,.ts,.tsx"
},
"dependencies": {
"@web3modal/core": "3.6.0-alpha.0",
"zod": "3.22.4"
},
"keywords": [
Expand Down
4 changes: 4 additions & 0 deletions packages/wallet/src/W3mFrameHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,9 @@ export const W3mFrameHelpers = {
} catch {
return false
}
},

getTimeDifferenceMs(deadlineMs: number) {
return Date.now() - deadlineMs
}
}
4 changes: 2 additions & 2 deletions packages/wallet/src/W3mFrameProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { W3mFrame } from './W3mFrame.js'
import type { W3mFrameTypes } from './W3mFrameTypes.js'
import { W3mFrameConstants } from './W3mFrameConstants.js'
import { W3mFrameStorage } from './W3mFrameStorage.js'
import { CoreHelperUtil } from '@web3modal/core'
import { W3mFrameHelpers } from './W3mFrameHelpers.js'

// -- Types -----------------------------------------------------------
type Resolver<T> = { resolve: (value: T) => void; reject: (reason?: unknown) => void } | undefined
Expand Down Expand Up @@ -98,7 +98,7 @@ export class W3mFrameProvider {
await this.w3mFrame.frameLoadPromise
const lastEmailLoginTime = W3mFrameStorage.get(W3mFrameConstants.LAST_EMAIL_LOGIN_TIME)
if (lastEmailLoginTime) {
const difference = CoreHelperUtil.getTimeDifferenceMs(Number(lastEmailLoginTime))
const difference = W3mFrameHelpers.getTimeDifferenceMs(Number(lastEmailLoginTime))
if (difference < 30_000) {
const cooldownSec = Math.ceil((30_000 - difference) / 1000)
throw new Error(`Please try again after ${cooldownSec} seconds`)
Expand Down

0 comments on commit 37fb52b

Please sign in to comment.