4971 add issyncenabled toggle in messaging settings (#4995)

- Closes #4971
- Fix calendar import to take isSyncEnabled into account
This commit is contained in:
bosiraphael
2024-04-17 13:35:23 +02:00
committed by GitHub
parent 67db7d85c0
commit 3024e04a1c
16 changed files with 147 additions and 97 deletions

View File

@ -63,7 +63,9 @@ export class GmailFetchMessageContentFromCacheService {
return;
}
if (connectedAccount.authFailedAt) {
const { accessToken, refreshToken, authFailedAt } = connectedAccount;
if (authFailedAt) {
this.logger.error(
`Connected account ${connectedAccountId} in workspace ${workspaceId} is in a failed state. Skipping...`,
);
@ -71,9 +73,6 @@ export class GmailFetchMessageContentFromCacheService {
return;
}
const accessToken = connectedAccount.accessToken;
const refreshToken = connectedAccount.refreshToken;
if (!refreshToken) {
throw new Error(
`No refresh token found for connected account ${connectedAccountId} in workspace ${workspaceId}`,