diff --git a/dictation_client/src/pages/LicensePage/cardLicenseActivatePopup.tsx b/dictation_client/src/pages/LicensePage/cardLicenseActivatePopup.tsx index 1d2909e..6b7b79a 100644 --- a/dictation_client/src/pages/LicensePage/cardLicenseActivatePopup.tsx +++ b/dictation_client/src/pages/LicensePage/cardLicenseActivatePopup.tsx @@ -46,24 +46,6 @@ export const CardLicenseActivatePopup: React.FC< onClose(); }, [isLoading, onClose]); - // ブラウザのウィンドウが閉じられようとしている場合に発火するイベントハンドラ - const handleBeforeUnload = (e: BeforeUnloadEvent) => { - // isLoadingがtrueの場合は確認ダイアログを表示する - if (isLoading) { - e.preventDefault(); - // ChromeではreturnValueが必要 - e.returnValue = ""; - } - }; - // コンポーネントがマウントされた時にイベントハンドラを登録する - useEffect(() => { - window.addEventListener("beforeunload", handleBeforeUnload); - // コンポーネントがアンマウントされるときにイベントハンドラを解除する - return () => { - window.removeEventListener("beforeunload", handleBeforeUnload); - }; - }); - useEffect( () => () => { // useEffectのreturnとしてcleanupAppsを実行することで、ポップアップのアンマウント時に初期化を行う diff --git a/dictation_client/src/pages/LicensePage/cardLicenseIssuePopup.tsx b/dictation_client/src/pages/LicensePage/cardLicenseIssuePopup.tsx index 84b466d..9298a50 100644 --- a/dictation_client/src/pages/LicensePage/cardLicenseIssuePopup.tsx +++ b/dictation_client/src/pages/LicensePage/cardLicenseIssuePopup.tsx @@ -31,7 +31,7 @@ export const CardLicenseIssuePopup: React.FC = ( // ブラウザのウィンドウが閉じられようとしている場合に発火するイベントハンドラ const handleBeforeUnload = (e: BeforeUnloadEvent) => { - // isLoadingがtrueの場合は確認ダイアログを表示する + // 後続の処理で、ブラウザのCSVダウンロードを行うため、ダイアログを表示させる if (isLoading) { e.preventDefault(); // ChromeではreturnValueが必要 diff --git a/dictation_client/src/pages/LicensePage/licenseOrderHistory.tsx b/dictation_client/src/pages/LicensePage/licenseOrderHistory.tsx index cc6d2ca..aee1606 100644 --- a/dictation_client/src/pages/LicensePage/licenseOrderHistory.tsx +++ b/dictation_client/src/pages/LicensePage/licenseOrderHistory.tsx @@ -291,8 +291,7 @@ export const LicenseOrderHistory: React.FC = ( ? styles.isActive : "" }`} - onClick={(event) => { - event.preventDefault(); + onClick={() => { issueLicense(x.poNumber); }} > @@ -312,8 +311,7 @@ export const LicenseOrderHistory: React.FC = ( ? styles.isActive : "" }`} - onClick={(event) => { - event.preventDefault(); + onClick={() => { onCancelIssue( selectedRow.accountId, x.poNumber diff --git a/dictation_client/src/pages/PartnerPage/addPartnerAccountPopup.tsx b/dictation_client/src/pages/PartnerPage/addPartnerAccountPopup.tsx index 565bfe7..43453b8 100644 --- a/dictation_client/src/pages/PartnerPage/addPartnerAccountPopup.tsx +++ b/dictation_client/src/pages/PartnerPage/addPartnerAccountPopup.tsx @@ -51,24 +51,7 @@ export const AddPartnerAccountPopup: React.FC = ( const email = useSelector(selectEmail); const isLoading = useSelector(selectIsLoading); - // ブラウザのウィンドウが閉じられようとしている場合に発火するイベントハンドラ - const handleBeforeUnload = (e: BeforeUnloadEvent) => { - // isLoadingがtrueの場合は確認ダイアログを表示する - if (isLoading) { - e.preventDefault(); - // ChromeではreturnValueが必要 - e.returnValue = ""; - } - }; - // コンポーネントがマウントされた時にイベントハンドラを登録する - useEffect(() => { - window.addEventListener("beforeunload", handleBeforeUnload); - // コンポーネントがアンマウントされるときにイベントハンドラを解除する - return () => { - window.removeEventListener("beforeunload", handleBeforeUnload); - }; - }); - + // ポップアップを閉じる処理 const closePopup = useCallback(() => { if (isLoading) { return;