Skip to content

Commit

Permalink
Merge branch 'main' into sdk-credentials-method
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobmischka committed Jun 5, 2023
2 parents 83d20f2 + 04db092 commit 28b2efe
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/classes/IntervalClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -337,8 +337,13 @@ export default class IntervalClient {

if (this.#isInitialized && !this.#reinitializeTimeout) {
this.#reinitializeTimeout = setTimeout(async () => {
await this.#initializeHost()
this.#reinitializeTimeout = null
try {
await this.#initializeHost()
} catch (err) {
this.#logger.error('Failed to reinitialize on routes change', err)
} finally {
this.#reinitializeTimeout = null
}
}, this.#reinitializeBatchTimeoutMs)
}
}
Expand Down Expand Up @@ -789,7 +794,8 @@ export default class IntervalClient {
this.#resendPendingPageLayouts()
})
.catch(err => {
this.#logger.debug('Failed resending saved calls', err)
this.#logger.debug('Failed reestablishing connection', err)
this.#isConnected = false
})

this.#log.prod(
Expand Down
5 changes: 5 additions & 0 deletions src/examples/basic/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,11 @@ const prod = new Interval({
backgroundable: true,
handler: async () => {
const first = await io.input.text('First input')
await ctx.loading.start({
label: 'Thinking...',
description: 'This will take 5 seconds, feel free to navigate away.',
})
await sleep(5_000)
const second = await io.input.text('Second input')

return { first, second }
Expand Down

0 comments on commit 28b2efe

Please sign in to comment.