saveFBLoginData: function saveFBLoginData()

in view/adminhtml/web/js/lib/fbe.js [70:99]


  saveFBLoginData: function saveFBLoginData(data) {
    var _this = this;
    if (data) {
      var responseObj = JSON.parse(data);
      _this.consoleLog("Response from fb login -- " + responseObj);
      var accessToken = responseObj.access_token;
      var success = responseObj.success;
      var pixelId = responseObj.pixel_id;
      var profiles = responseObj.profiles;
      var catalogId = responseObj.catalog_id;

      if(success) {
        let action = responseObj.action;
        if(action != null && action === 'delete') {
          // Delete asset ids stored in db instance.
          _this.consoleLog("Successfully uninstalled FBE");
            _this.deleteFBAssets();
        }else if(action != null && action === 'create') {
          _this.savePixelId(pixelId);
          _this.saveAccessToken(accessToken);
          _this.saveProfilesData(profiles);
          _this.saveAAMSettings(pixelId);
          _this.pushFeed(accessToken, catalogId);
          _this.setState({installed: 'true'});
        }
      }else {
        _this.consoleLog("No response received after setup");
      }
    }
  },