Skip to content

Commit

Permalink
sessions: allow app to restart from previous session
Browse files Browse the repository at this point in the history
Signed-off-by: andrew <[email protected]>
andrewxhill committed Feb 6, 2020

Verified

This commit was signed with the committer’s verified signature. The key has expired.
andrewxhill Andrew W. Hill
1 parent ad155dc commit 2106a6f
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/ThreadsConfig.ts
Original file line number Diff line number Diff line change
@@ -21,7 +21,11 @@ export class ThreadsConfig extends Config {
super()
this.host = `${this.apiScheme}://${this.api}:${this.threadsPort}`
}
async start() {
async start(sessionId?: string) {
if (sessionId !== undefined) {
this.session = sessionId
return
}
await this.refreshSession()
}
get sessionAPI(): string {
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -50,8 +50,8 @@ export class API {
)
}

async start() {
await this._threadsConfig.start()
async start(sessionId?: string) {
await this._threadsConfig.start(sessionId)
return this
}

0 comments on commit 2106a6f

Please sign in to comment.