sales-frontend-components 0.0.101 → 0.0.103
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.cjs.js +16 -10
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.esm.js +17 -11
- package/dist/index.esm.js.map +1 -1
- package/package.json +11 -11
package/dist/index.d.ts
CHANGED
|
@@ -526,4 +526,4 @@ interface ClientSessionProviderProps {
|
|
|
526
526
|
declare const ClientSessionProvider: ({ children, loadingComponent }: ClientSessionProviderProps) => react_jsx_runtime.JSX.Element;
|
|
527
527
|
|
|
528
528
|
export { Attachment, BankStockSearchModal, CODES, ClientSessionProvider, CustomerSearch, DeaCustomerSearchModal, EmployeeSearchModal, FormCheckbox, FormCheckboxButton, FormDatePicker, FormDateRangePicker, FormSearchJobField, FormSegmentGroup, FormSelect, FormTextField, JobVehicleSearchModal, OrganizationSearchModal, StepIndicator, resize, testSignatureBase64Data, useAddressComponent, useBankStockSearch, useCamera, useCanvasPaint, useJobSearchModal, useJobVehicleSearchModal, useNationalityComponent, useNxlOneModal, useRemoteIdentityVerification, useRemoteIdentityVerificationIframe, useRemoteIdentityVerificationPopup, useSearchAddress, useSearchNationality, useSearchVisa, useSetupClientSession, useVisaComponent };
|
|
529
|
-
export type { AttachedPhoto, AttachmentProps, BankStockSearchModalProps, CodeSet, DownloadProps, NxlOneProps, NxlOneResponse, PaintProps, Pen, RemoteIdentityVerificationSuccess, RivUrlParams, Step, StepIndicatorProps, StepItem, UseRemoteIdentityVerificationProps, VerificationResponse, cameraItemType, cameraOptions };
|
|
529
|
+
export type { AttachedPhoto, AttachmentProps, BankStockSearchModalProps, CodeSet, DownloadProps, FormSegmentGroupProps, NxlOneProps, NxlOneResponse, PaintProps, Pen, RemoteIdentityVerificationSuccess, RivUrlParams, Step, StepIndicatorProps, StepItem, UseRemoteIdentityVerificationProps, VerificationResponse, cameraItemType, cameraOptions };
|
package/dist/index.esm.js
CHANGED
|
@@ -8,7 +8,7 @@ import styles from './modal/standard/address-search/select-address.module.scss';
|
|
|
8
8
|
import styles$1 from './modal/standard/bank-stock-search/bank-stock-search-modal.module.scss';
|
|
9
9
|
import styles$2 from './modal/standard/customer-search/customer-search.module.scss';
|
|
10
10
|
import styles$3 from './modal/standard/nationality-search/select-nationality.module.scss';
|
|
11
|
-
import { isClient, MessageEventManager, getCookie, getDeviceModel, getOSVersion, getOSName, getBrowserVersion, getOrCreateDeviceId, isSalesPortal, getFormFactorFromUserAgent, isWebView } from 'sales-frontend-utils';
|
|
11
|
+
import { isClient, MessageEventManager, isFpPlannerApp, getCookie, getDeviceModel, getOSVersion, getOSName, getBrowserVersion, getOrCreateDeviceId, isSalesPortal, getFormFactorFromUserAgent, isWebView } from 'sales-frontend-utils';
|
|
12
12
|
import styles$4 from './modal/standard/visa-search/select-visa.module.scss';
|
|
13
13
|
import { useQuery } from '@tanstack/react-query';
|
|
14
14
|
import styles$5 from './modal/pre-standard/dea-customer-search-modal/dea-customer-search-modal.module.scss';
|
|
@@ -4015,13 +4015,13 @@ const createPureWebClientSession = async () => {
|
|
|
4015
4015
|
};
|
|
4016
4016
|
};
|
|
4017
4017
|
const createWebviewClientSession = async () => {
|
|
4018
|
-
const isLoggedIn = !!(await Bridge.native.getAccessToken()).accessToken;
|
|
4018
|
+
const isLoggedIn = isFpPlannerApp() ? !!getCookie("accessToken") : !!(await Bridge.native.getAccessToken()).accessToken;
|
|
4019
4019
|
return {
|
|
4020
4020
|
isInitialized: true,
|
|
4021
4021
|
isLoggedIn,
|
|
4022
4022
|
isWebView: true,
|
|
4023
4023
|
acceptLanguage: "ko",
|
|
4024
|
-
formFactor: getCookie("formFactor") || getFormFactor(),
|
|
4024
|
+
formFactor: getCookie("formFactor")?.toLowerCase() || getFormFactor(),
|
|
4025
4025
|
deviceId: getCookie("deviceId"),
|
|
4026
4026
|
//! App
|
|
4027
4027
|
appVersion: getCookie("appVersion"),
|
|
@@ -4048,7 +4048,7 @@ const getLoginUserInfo = async () => {
|
|
|
4048
4048
|
};
|
|
4049
4049
|
|
|
4050
4050
|
const useSetupClientSession = () => {
|
|
4051
|
-
const { isInitialized } = useClientSession();
|
|
4051
|
+
const { isInitialized, isLoggedIn } = useClientSession();
|
|
4052
4052
|
const setClientSession = useSetClientSession();
|
|
4053
4053
|
useEffect(() => {
|
|
4054
4054
|
if (isInitialized) {
|
|
@@ -4066,19 +4066,25 @@ const useSetupClientSession = () => {
|
|
|
4066
4066
|
setClientSession(await createPureWebClientSession());
|
|
4067
4067
|
}
|
|
4068
4068
|
console.log("[useSetupClientSession] \uAE30\uBCF8 \uC138\uC158 \uC124\uC815 \uC644\uB8CC");
|
|
4069
|
-
if (getCookie("accessToken")) {
|
|
4070
|
-
console.log("[useSetupClientSession] \uC0AC\uC6A9\uC790 \uD504\uB85C\uD544 \uB85C\uB4DC \uC2DC\uC791...");
|
|
4071
|
-
const userInfo = await getLoginUserInfo();
|
|
4072
|
-
if (userInfo) {
|
|
4073
|
-
setClientSession(userInfo);
|
|
4074
|
-
}
|
|
4075
|
-
}
|
|
4076
4069
|
} catch (error) {
|
|
4077
4070
|
console.error("[useSetupClientSession] \uCD08\uAE30\uD654 \uC2E4\uD328:", error);
|
|
4078
4071
|
}
|
|
4079
4072
|
};
|
|
4080
4073
|
initialize();
|
|
4081
4074
|
}, [isInitialized, setClientSession]);
|
|
4075
|
+
useEffect(() => {
|
|
4076
|
+
if (!isInitialized || !isLoggedIn) {
|
|
4077
|
+
return;
|
|
4078
|
+
}
|
|
4079
|
+
const loadUserInfo = async () => {
|
|
4080
|
+
console.log("[useSetupClientSession] \uC0AC\uC6A9\uC790 \uD504\uB85C\uD544 \uB85C\uB4DC \uC2DC\uC791...");
|
|
4081
|
+
const userInfo = await getLoginUserInfo();
|
|
4082
|
+
if (userInfo) {
|
|
4083
|
+
setClientSession(userInfo);
|
|
4084
|
+
}
|
|
4085
|
+
};
|
|
4086
|
+
loadUserInfo();
|
|
4087
|
+
}, [isInitialized, isLoggedIn, setClientSession]);
|
|
4082
4088
|
return isInitialized ?? false;
|
|
4083
4089
|
};
|
|
4084
4090
|
|