Skip to content

Refactor REST client #286

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 3, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Convert setSessionToken to async
  • Loading branch information
code-asher committed May 29, 2024
commit 916d7690e19a428f5e3f389255d867b9202132e4
12 changes: 5 additions & 7 deletions src/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,13 @@ export class Storage {
return urls.size > MAX_URLS ? Array.from(urls).slice(urls.size - MAX_URLS, urls.size) : Array.from(urls)
}

public setSessionToken(sessionToken?: string): Thenable<void> {
public async setSessionToken(sessionToken?: string): Promise<void> {
if (!sessionToken) {
return this.secrets.delete("sessionToken").then(() => {
return this.updateSessionToken()
})
await this.secrets.delete("sessionToken")
} else {
await this.secrets.store("sessionToken", sessionToken)
}
return this.secrets.store("sessionToken", sessionToken).then(() => {
return this.updateSessionToken()
})
return this.updateSessionToken()
}

public async getSessionToken(): Promise<string | undefined> {
Expand Down