Skip to content

Commit 726a4c9

Browse files
committed
authEventHandled as boolean
1 parent ad44589 commit 726a4c9

File tree

1 file changed

+4
-4
lines changed
  • src/Umbraco.Cms.Integrations.Crm.Hubspot/App_Plugins/UmbracoCms.Integrations/Crm/Hubspot/js

1 file changed

+4
-4
lines changed

src/Umbraco.Cms.Integrations.Crm.Hubspot/App_Plugins/UmbracoCms.Integrations/Crm/Hubspot/js/settings.controller.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
const oauthName = "OAuth";
66

77
vm.oauthSetup = {
8-
authEventHandled : 0
8+
authEventHandled : false
99
};
1010
vm.status = {};
1111

@@ -51,7 +51,7 @@
5151
vm.onRevokeToken = function() {
5252
umbracoCmsIntegrationsCrmHubspotResource.revokeAccessToken().then(function (response) {
5353
vm.oauthSetup.isConnected = false;
54-
vm.oauthSetup.authEventHandled = 0;
54+
vm.oauthSetup.authEventHandled = false;
5555

5656
if(typeof $scope.connected === "undefined")
5757
notificationsService.success("HubSpot Configuration", "OAuth connection revoked.");
@@ -66,11 +66,11 @@
6666

6767
if (event.data.type === "hubspot:oauth:success") {
6868

69-
if (vm.oauthSetup.authEventHandled != 0) return;
69+
if (vm.oauthSetup.authEventHandled === true) return;
7070

7171
umbracoCmsIntegrationsCrmHubspotResource.getAccessToken(event.data.code).then(function (response) {
7272

73-
vm.oauthSetup.authEventHandled = 1;
73+
vm.oauthSetup.authEventHandled = true;
7474

7575
if (response.startsWith("Error:")) {
7676
if (typeof $scope.connected === "undefined")

0 commit comments

Comments
 (0)