We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1074597 commit ce1cacbCopy full SHA for ce1cacb
src/services/readwise-api.ts
@@ -64,14 +64,12 @@ export default class ReadwiseApi {
64
* @returns {Promise<boolean>} - Returns a promise that resolves to a boolean indicating if the token is valid
65
*/
66
async hasValidToken(): Promise<boolean> {
67
- if (this.validToken === undefined) {
68
- this.validateToken().then((value) => {
69
- this.validToken = value;
70
- return value;
71
- });
72
- }
73
- return this.validToken;
74
+ async hasValidToken(): Promise<boolean> {
+ if (this.validToken === undefined) {
+ this.validToken = await this.validateToken();
+ }
+ return this.validToken;
75
76
/**
77
* Checks if the token is valid by making a request to the Readwise API
0 commit comments