fix: old providers without selection
This commit is contained in:
parent
691d15db03
commit
3f674de401
|
|
@ -288,6 +288,7 @@ export class PostActivity {
|
|||
|
||||
return refresh;
|
||||
} catch (err) {
|
||||
await this._refreshIntegrationService.setBetweenSteps(integration);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -309,6 +309,16 @@ export class IntegrationRepository {
|
|||
});
|
||||
}
|
||||
|
||||
async setBetweenRefreshSteps(id: string) {
|
||||
return this._integration.model.integration.update({
|
||||
where: {
|
||||
id,
|
||||
},
|
||||
data: {
|
||||
inBetweenSteps: true,
|
||||
},
|
||||
});
|
||||
}
|
||||
refreshNeeded(org: string, id: string) {
|
||||
return this._integration.model.integration.update({
|
||||
where: {
|
||||
|
|
|
|||
|
|
@ -204,6 +204,10 @@ export class IntegrationService {
|
|||
return this._integrationRepository.refreshNeeded(org, id);
|
||||
}
|
||||
|
||||
async setBetweenRefreshSteps(id: string) {
|
||||
return this._integrationRepository.setBetweenRefreshSteps(id);
|
||||
}
|
||||
|
||||
async refreshTokens() {
|
||||
const integrations = await this._integrationRepository.needsToBeRefreshed();
|
||||
for (const integration of integrations) {
|
||||
|
|
|
|||
|
|
@ -42,6 +42,14 @@ export class RefreshIntegrationService {
|
|||
return refresh;
|
||||
}
|
||||
|
||||
public async setBetweenSteps(integration: Integration) {
|
||||
await this._integrationService.setBetweenRefreshSteps(integration.id);
|
||||
await this._integrationService.informAboutRefreshError(
|
||||
integration.organizationId,
|
||||
integration
|
||||
);
|
||||
}
|
||||
|
||||
private async refreshProcess(
|
||||
integration: Integration,
|
||||
socialProvider: SocialProvider
|
||||
|
|
@ -61,12 +69,18 @@ export class RefreshIntegrationService {
|
|||
integration
|
||||
);
|
||||
|
||||
await this._integrationService.disconnectChannel(integration.organizationId, integration);
|
||||
await this._integrationService.disconnectChannel(
|
||||
integration.organizationId,
|
||||
integration
|
||||
);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!socialProvider.reConnect) {
|
||||
if (
|
||||
!socialProvider.reConnect ||
|
||||
integration.rootInternalId === integration.internalId
|
||||
) {
|
||||
return refresh;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue