File tree 2 files changed +2
-2
lines changed
2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ export function activate(
64
64
// Read cached token from storage if it exists and store it in memory.
65
65
newState . cachedTokenPromise = readTokenFromStorage ( app ) . then ( cachedToken => {
66
66
if ( cachedToken && isValid ( cachedToken ) ) {
67
- newState . token = cachedToken ;
67
+ setState ( app , { ... getState ( app ) , token : cachedToken } ) ;
68
68
}
69
69
return cachedToken ;
70
70
} ) ;
Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ export async function getToken(
64
64
* If there is no token in memory, try to load token from indexedDB.
65
65
*/
66
66
if ( ! token ) {
67
- // readTokenFromStorage() always resolves. In case of an error, it resolves with `undefined` .
67
+ // cachedTokenPromise contains the token found in IndexedDB or undefined if not found .
68
68
const cachedToken = await state . cachedTokenPromise ;
69
69
if ( cachedToken && isValid ( cachedToken ) ) {
70
70
token = cachedToken ;
You can’t perform that action at this time.
0 commit comments