Skip to content

Commit

Permalink
fix(spinner): hide spinner while printing access token expiry time
Browse files Browse the repository at this point in the history
Signed-off-by: Vedant K <gamemaker0042@gmail.com>
  • Loading branch information
gamemaker1 committed Apr 7, 2021
1 parent 59edb12 commit 973cd34
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ exports.generateBodyAndHeaders = async (drive) => {
// A helper function to regenerate the access token in case
// it has expired
exports.refreshAccessToken = async (drive) => {
// Stop loading
const spinnerText = this.stopSpin()
// The provider config
let providerConfigJson = await axios.get(
'https://dabbu-knowledge-platform.github.io/schema/provider-fields.json'
Expand Down Expand Up @@ -207,13 +209,13 @@ exports.refreshAccessToken = async (drive) => {
this.get(`drives.${drive}.${providerConfig.auth.path}.expires-at`)
).toLocaleString()}`
)
// Return successfully
} else {
// If it is not expired, return successfully
}
} else {
// If there is no auth required for that provider, return successfully
// If it is not expired, return successfully
}

// If there is no auth required for that provider, return successfully
// Before returning, resume loading
this.startSpin(spinnerText)
}

// Return an absolute path based on the current path in
Expand Down

0 comments on commit 973cd34

Please sign in to comment.