Skip to content

Commit

Permalink
fix: setTimeout on sdk create warning on overflow integer
Browse files Browse the repository at this point in the history
  • Loading branch information
tyohan committed Sep 19, 2024
1 parent 3b7c75a commit b79c6e1
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions packages/room/api/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ export const createApi = ({ fetcher, config }) => {
_fetcher
/** @type {import('./api-types.js').RoomAPIType.ApiAuth | null} */
_auth = null
/** @type {ReturnType<typeof setTimeout> | null} */
_authTimeout = null

constructor() {
this._fetcher = fetcher
Expand Down Expand Up @@ -814,21 +812,6 @@ export const createApi = ({ fetcher, config }) => {
const url = new URL(auth.url)
const apiVersion = url.pathname.split('/')[1]

if (this._authTimeout) {
clearTimeout(this._authTimeout)
this._authTimeout = null
}

this._authTimeout = setTimeout(async () => {
const authResponse = await createAuth({
baseUrl: url.origin,
apiVersion: apiVersion,
apiKey: auth.data.refreshToken,
expirySeconds: auth.data.expirySeconds,
})
this._auth = this.setAuth(authResponse)
}, auth.data.expirySeconds * 1000)

const data = {
baseUrl: url.origin,
apiVersion: apiVersion,
Expand Down

0 comments on commit b79c6e1

Please sign in to comment.