@connectedxm/client 1.3.11 → 1.3.13
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/dist/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +7 -3
- package/dist/index.mjs +7 -3
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1788,6 +1788,7 @@ interface OrganizationConfig {
|
|
|
1788
1788
|
ADAPTIVE_ICON: string | null;
|
|
1789
1789
|
SPLASH_SCREEN: string | null;
|
|
1790
1790
|
DEFAULT_LOCALE: SupportedLocale;
|
|
1791
|
+
LOCALES: SupportedLocale[];
|
|
1791
1792
|
LANGUAGES: Partial<Record<SupportedLocale, Record<string, string>>>;
|
|
1792
1793
|
AUTH: {
|
|
1793
1794
|
LAYOUT: "default" | "social";
|
|
@@ -1854,7 +1855,7 @@ interface ConnectedXMClientContextState {
|
|
|
1854
1855
|
queryClient: QueryClient;
|
|
1855
1856
|
organizationId: string;
|
|
1856
1857
|
apiUrl: "https://client-api.connected.dev" | "https://staging-client-api.connected.dev" | "http://localhost:4001";
|
|
1857
|
-
authenticated: boolean;
|
|
1858
|
+
authenticated: boolean | null;
|
|
1858
1859
|
setAuthenticated: (authenticated: boolean) => void;
|
|
1859
1860
|
getToken: () => Promise<string | undefined>;
|
|
1860
1861
|
getExecuteAs?: () => Promise<string | undefined> | string | undefined;
|
package/dist/index.d.ts
CHANGED
|
@@ -1788,6 +1788,7 @@ interface OrganizationConfig {
|
|
|
1788
1788
|
ADAPTIVE_ICON: string | null;
|
|
1789
1789
|
SPLASH_SCREEN: string | null;
|
|
1790
1790
|
DEFAULT_LOCALE: SupportedLocale;
|
|
1791
|
+
LOCALES: SupportedLocale[];
|
|
1791
1792
|
LANGUAGES: Partial<Record<SupportedLocale, Record<string, string>>>;
|
|
1792
1793
|
AUTH: {
|
|
1793
1794
|
LAYOUT: "default" | "social";
|
|
@@ -1854,7 +1855,7 @@ interface ConnectedXMClientContextState {
|
|
|
1854
1855
|
queryClient: QueryClient;
|
|
1855
1856
|
organizationId: string;
|
|
1856
1857
|
apiUrl: "https://client-api.connected.dev" | "https://staging-client-api.connected.dev" | "http://localhost:4001";
|
|
1857
|
-
authenticated: boolean;
|
|
1858
|
+
authenticated: boolean | null;
|
|
1858
1859
|
setAuthenticated: (authenticated: boolean) => void;
|
|
1859
1860
|
getToken: () => Promise<string | undefined>;
|
|
1860
1861
|
getExecuteAs?: () => Promise<string | undefined> | string | undefined;
|
package/dist/index.js
CHANGED
|
@@ -1007,13 +1007,17 @@ var ConnectedXMProvider = ({
|
|
|
1007
1007
|
getToken,
|
|
1008
1008
|
...state
|
|
1009
1009
|
}) => {
|
|
1010
|
-
const [authenticated, setAuthenticated] = import_react.default.useState(
|
|
1010
|
+
const [authenticated, setAuthenticated] = import_react.default.useState(
|
|
1011
|
+
null
|
|
1012
|
+
);
|
|
1011
1013
|
const [ssr, setSSR] = import_react.default.useState(true);
|
|
1012
1014
|
import_react.default.useEffect(() => {
|
|
1013
1015
|
if (!authenticated) {
|
|
1014
1016
|
getToken().then((token) => {
|
|
1015
1017
|
if (token) {
|
|
1016
1018
|
setAuthenticated(true);
|
|
1019
|
+
} else {
|
|
1020
|
+
setAuthenticated(false);
|
|
1017
1021
|
}
|
|
1018
1022
|
});
|
|
1019
1023
|
}
|
|
@@ -5316,7 +5320,7 @@ var useGetSelf = (ignoreExecuteAs, options = {}) => {
|
|
|
5316
5320
|
(params) => GetSelf({ ignoreExecuteAs, ...params }),
|
|
5317
5321
|
{
|
|
5318
5322
|
...options,
|
|
5319
|
-
enabled: authenticated && (options?.enabled ?? true)
|
|
5323
|
+
enabled: !!authenticated && (options?.enabled ?? true)
|
|
5320
5324
|
}
|
|
5321
5325
|
);
|
|
5322
5326
|
};
|
|
@@ -7063,7 +7067,7 @@ var useGetSelfNotificationPreferences = (options = {}) => {
|
|
|
7063
7067
|
(params) => GetSelfNotificationPreferences({ ...params }),
|
|
7064
7068
|
{
|
|
7065
7069
|
...options,
|
|
7066
|
-
enabled: authenticated && (options?.enabled ?? true)
|
|
7070
|
+
enabled: !!authenticated && (options?.enabled ?? true)
|
|
7067
7071
|
}
|
|
7068
7072
|
);
|
|
7069
7073
|
};
|
package/dist/index.mjs
CHANGED
|
@@ -12,13 +12,17 @@ var ConnectedXMProvider = ({
|
|
|
12
12
|
getToken,
|
|
13
13
|
...state
|
|
14
14
|
}) => {
|
|
15
|
-
const [authenticated, setAuthenticated] = React.useState(
|
|
15
|
+
const [authenticated, setAuthenticated] = React.useState(
|
|
16
|
+
null
|
|
17
|
+
);
|
|
16
18
|
const [ssr, setSSR] = React.useState(true);
|
|
17
19
|
React.useEffect(() => {
|
|
18
20
|
if (!authenticated) {
|
|
19
21
|
getToken().then((token) => {
|
|
20
22
|
if (token) {
|
|
21
23
|
setAuthenticated(true);
|
|
24
|
+
} else {
|
|
25
|
+
setAuthenticated(false);
|
|
22
26
|
}
|
|
23
27
|
});
|
|
24
28
|
}
|
|
@@ -4323,7 +4327,7 @@ var useGetSelf = (ignoreExecuteAs, options = {}) => {
|
|
|
4323
4327
|
(params) => GetSelf({ ignoreExecuteAs, ...params }),
|
|
4324
4328
|
{
|
|
4325
4329
|
...options,
|
|
4326
|
-
enabled: authenticated && (options?.enabled ?? true)
|
|
4330
|
+
enabled: !!authenticated && (options?.enabled ?? true)
|
|
4327
4331
|
}
|
|
4328
4332
|
);
|
|
4329
4333
|
};
|
|
@@ -6070,7 +6074,7 @@ var useGetSelfNotificationPreferences = (options = {}) => {
|
|
|
6070
6074
|
(params) => GetSelfNotificationPreferences({ ...params }),
|
|
6071
6075
|
{
|
|
6072
6076
|
...options,
|
|
6073
|
-
enabled: authenticated && (options?.enabled ?? true)
|
|
6077
|
+
enabled: !!authenticated && (options?.enabled ?? true)
|
|
6074
6078
|
}
|
|
6075
6079
|
);
|
|
6076
6080
|
};
|