@atlaskit/teams-client 4.13.0 → 4.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @atlaskit/teams-client
2
2
 
3
+ ## 4.13.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`21d91ec75d514`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/21d91ec75d514) -
8
+ Fix for race condition
9
+
3
10
  ## 4.13.0
4
11
 
5
12
  ### Minor Changes
@@ -52,7 +52,7 @@ var TeamsUFOExperience = exports.TeamsUFOExperience = /*#__PURE__*/function (_UF
52
52
  return _superPropGet(TeamsUFOExperience, "failure", this, 3)([{
53
53
  metadata: {
54
54
  error: (0, _utils.createErrorMetadata)(error),
55
- packageVersion: "4.12.0",
55
+ packageVersion: "0.0.0-development",
56
56
  packageName: "@atlaskit/teams-client"
57
57
  }
58
58
  }]);
@@ -60,7 +60,7 @@ var TeamsUFOExperience = exports.TeamsUFOExperience = /*#__PURE__*/function (_UF
60
60
  return _superPropGet(TeamsUFOExperience, "failure", this, 3)([{
61
61
  metadata: {
62
62
  error: 'unknown error',
63
- packageVersion: "4.12.0",
63
+ packageVersion: "0.0.0-development",
64
64
  packageName: "@atlaskit/teams-client"
65
65
  }
66
66
  }]);
@@ -1,9 +1,11 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
6
7
  exports.useTeamsClientSetupNext = exports.useTeamsClientSetup = void 0;
8
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
7
9
  var _react = require("react");
8
10
  var _main = require("../main");
9
11
  var _main2 = require("../sentry/main");
@@ -23,6 +25,10 @@ var useTeamsClientSetupNext = exports.useTeamsClientSetupNext = function useTeam
23
25
  cloudId = _ref.cloudId,
24
26
  orgId = _ref.orgId,
25
27
  principalUserId = _ref.principalUserId;
28
+ var _useState = (0, _react.useState)(false),
29
+ _useState2 = (0, _slicedToArray2.default)(_useState, 2),
30
+ isClientReady = _useState2[0],
31
+ setIsClientReady = _useState2[1];
26
32
  (0, _react.useEffect)(function () {
27
33
  if (!stargateRoot) {
28
34
  return;
@@ -40,6 +46,9 @@ var useTeamsClientSetupNext = exports.useTeamsClientSetupNext = function useTeam
40
46
  cloudId: cloudId
41
47
  });
42
48
  }
49
+
50
+ // Mark client as ready after context is set
51
+ setIsClientReady(true);
43
52
  }, [cloudId, orgId, principalUserId]);
44
53
  (0, _react.useEffect)(function () {
45
54
  if (!stargateRoot) {
@@ -51,4 +60,7 @@ var useTeamsClientSetupNext = exports.useTeamsClientSetupNext = function useTeam
51
60
  userId: principalUserId
52
61
  });
53
62
  }, [cloudId, orgId, principalUserId, stargateRoot]);
63
+ return {
64
+ isClientReady: isClientReady
65
+ };
54
66
  };
@@ -36,7 +36,7 @@ function getSentryConfig(options) {
36
36
  return _objectSpread(_objectSpread(_objectSpread({}, otherOptions), DEFAULT_SENTRY_CONFIG), {}, {
37
37
  // Standalone __VERSION__ is set from `bin/set-release-version.sh`
38
38
  // when building to deploy to production
39
- release: "".concat("@atlaskit/teams-client", "@").concat("4.12.0") ||
39
+ release: "".concat("@atlaskit/teams-client", "@").concat("0.0.0-development") ||
40
40
  // @ts-ignore Jira - window.BUILD_KEY
41
41
  window.BUILD_KEY || ( // @ts-ignore Confluence - window.__buildInfo
42
42
  (_window$__buildInfo = window.__buildInfo) === null || _window$__buildInfo === void 0 ? void 0 : _window$__buildInfo.FRONTEND_VERSION) || '---',
@@ -27,7 +27,7 @@ export class TeamsUFOExperience extends UFOExperience {
27
27
  return super.failure({
28
28
  metadata: {
29
29
  error: createErrorMetadata(error),
30
- packageVersion: "4.12.0",
30
+ packageVersion: "0.0.0-development",
31
31
  packageName: "@atlaskit/teams-client"
32
32
  }
33
33
  });
@@ -35,7 +35,7 @@ export class TeamsUFOExperience extends UFOExperience {
35
35
  return super.failure({
36
36
  metadata: {
37
37
  error: 'unknown error',
38
- packageVersion: "4.12.0",
38
+ packageVersion: "0.0.0-development",
39
39
  packageName: "@atlaskit/teams-client"
40
40
  }
41
41
  });
@@ -1,4 +1,4 @@
1
- import { useEffect } from 'react';
1
+ import { useEffect, useState } from 'react';
2
2
  import { teamsClient } from '../main';
3
3
  import { logInfoMessage } from '../sentry/main';
4
4
 
@@ -19,6 +19,7 @@ export const useTeamsClientSetupNext = ({
19
19
  orgId,
20
20
  principalUserId
21
21
  }) => {
22
+ const [isClientReady, setIsClientReady] = useState(false);
22
23
  useEffect(() => {
23
24
  if (!stargateRoot) {
24
25
  return;
@@ -36,6 +37,9 @@ export const useTeamsClientSetupNext = ({
36
37
  cloudId
37
38
  });
38
39
  }
40
+
41
+ // Mark client as ready after context is set
42
+ setIsClientReady(true);
39
43
  }, [cloudId, orgId, principalUserId]);
40
44
  useEffect(() => {
41
45
  if (!stargateRoot) {
@@ -47,4 +51,7 @@ export const useTeamsClientSetupNext = ({
47
51
  userId: principalUserId
48
52
  });
49
53
  }, [cloudId, orgId, principalUserId, stargateRoot]);
54
+ return {
55
+ isClientReady
56
+ };
50
57
  };
@@ -28,7 +28,7 @@ export function getSentryConfig(options) {
28
28
  ...DEFAULT_SENTRY_CONFIG,
29
29
  // Standalone __VERSION__ is set from `bin/set-release-version.sh`
30
30
  // when building to deploy to production
31
- release: `${"@atlaskit/teams-client"}@${"4.12.0"}` ||
31
+ release: `${"@atlaskit/teams-client"}@${"0.0.0-development"}` ||
32
32
  // @ts-ignore Jira - window.BUILD_KEY
33
33
  window.BUILD_KEY || ( // @ts-ignore Confluence - window.__buildInfo
34
34
  (_window$__buildInfo = window.__buildInfo) === null || _window$__buildInfo === void 0 ? void 0 : _window$__buildInfo.FRONTEND_VERSION) || '---',
@@ -45,7 +45,7 @@ export var TeamsUFOExperience = /*#__PURE__*/function (_UFOExperience) {
45
45
  return _superPropGet(TeamsUFOExperience, "failure", this, 3)([{
46
46
  metadata: {
47
47
  error: createErrorMetadata(error),
48
- packageVersion: "4.12.0",
48
+ packageVersion: "0.0.0-development",
49
49
  packageName: "@atlaskit/teams-client"
50
50
  }
51
51
  }]);
@@ -53,7 +53,7 @@ export var TeamsUFOExperience = /*#__PURE__*/function (_UFOExperience) {
53
53
  return _superPropGet(TeamsUFOExperience, "failure", this, 3)([{
54
54
  metadata: {
55
55
  error: 'unknown error',
56
- packageVersion: "4.12.0",
56
+ packageVersion: "0.0.0-development",
57
57
  packageName: "@atlaskit/teams-client"
58
58
  }
59
59
  }]);
@@ -1,4 +1,5 @@
1
- import { useEffect } from 'react';
1
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
+ import { useEffect, useState } from 'react';
2
3
  import { teamsClient } from '../main';
3
4
  import { logInfoMessage } from '../sentry/main';
4
5
 
@@ -18,6 +19,10 @@ export var useTeamsClientSetupNext = function useTeamsClientSetupNext(_ref) {
18
19
  cloudId = _ref.cloudId,
19
20
  orgId = _ref.orgId,
20
21
  principalUserId = _ref.principalUserId;
22
+ var _useState = useState(false),
23
+ _useState2 = _slicedToArray(_useState, 2),
24
+ isClientReady = _useState2[0],
25
+ setIsClientReady = _useState2[1];
21
26
  useEffect(function () {
22
27
  if (!stargateRoot) {
23
28
  return;
@@ -35,6 +40,9 @@ export var useTeamsClientSetupNext = function useTeamsClientSetupNext(_ref) {
35
40
  cloudId: cloudId
36
41
  });
37
42
  }
43
+
44
+ // Mark client as ready after context is set
45
+ setIsClientReady(true);
38
46
  }, [cloudId, orgId, principalUserId]);
39
47
  useEffect(function () {
40
48
  if (!stargateRoot) {
@@ -46,4 +54,7 @@ export var useTeamsClientSetupNext = function useTeamsClientSetupNext(_ref) {
46
54
  userId: principalUserId
47
55
  });
48
56
  }, [cloudId, orgId, principalUserId, stargateRoot]);
57
+ return {
58
+ isClientReady: isClientReady
59
+ };
49
60
  };
@@ -29,7 +29,7 @@ export function getSentryConfig(options) {
29
29
  return _objectSpread(_objectSpread(_objectSpread({}, otherOptions), DEFAULT_SENTRY_CONFIG), {}, {
30
30
  // Standalone __VERSION__ is set from `bin/set-release-version.sh`
31
31
  // when building to deploy to production
32
- release: "".concat("@atlaskit/teams-client", "@").concat("4.12.0") ||
32
+ release: "".concat("@atlaskit/teams-client", "@").concat("0.0.0-development") ||
33
33
  // @ts-ignore Jira - window.BUILD_KEY
34
34
  window.BUILD_KEY || ( // @ts-ignore Confluence - window.__buildInfo
35
35
  (_window$__buildInfo = window.__buildInfo) === null || _window$__buildInfo === void 0 ? void 0 : _window$__buildInfo.FRONTEND_VERSION) || '---',
@@ -8,5 +8,7 @@ type TeamsClientSetupProps = {
8
8
  orgId?: string;
9
9
  principalUserId?: string;
10
10
  };
11
- export declare const useTeamsClientSetupNext: ({ stargateRoot, cloudId, orgId, principalUserId, }: TeamsClientSetupProps) => void;
11
+ export declare const useTeamsClientSetupNext: ({ stargateRoot, cloudId, orgId, principalUserId, }: TeamsClientSetupProps) => {
12
+ isClientReady: boolean;
13
+ };
12
14
  export {};
@@ -8,5 +8,7 @@ type TeamsClientSetupProps = {
8
8
  orgId?: string;
9
9
  principalUserId?: string;
10
10
  };
11
- export declare const useTeamsClientSetupNext: ({ stargateRoot, cloudId, orgId, principalUserId, }: TeamsClientSetupProps) => void;
11
+ export declare const useTeamsClientSetupNext: ({ stargateRoot, cloudId, orgId, principalUserId, }: TeamsClientSetupProps) => {
12
+ isClientReady: boolean;
13
+ };
12
14
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/teams-client",
3
- "version": "4.13.0",
3
+ "version": "4.13.1",
4
4
  "description": "A client to retrieve team related data",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",