All files / src/sections/PayBuilder/Checkout/hooks useOpenProcessingIssueModal.ts

50% Statements 3/6
0% Branches 0/1
33.33% Functions 1/3
50% Lines 3/6

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19      13x 494x                   494x        
import NiceModal from "@ebay/nice-modal-react";
import { FAILED_TO_PROCESS_DONATION_MODAL } from "modals/modal_names";
 
export const useOpenProcessingIssueModal = () => {
  const handleOpenProcessingIssue = (isCartSessionTimeout = false) => {
    NiceModal.show(FAILED_TO_PROCESS_DONATION_MODAL, {
      isCartSessionTimeout,
      timeoutId: setTimeout(() => {
        NiceModal.hide(FAILED_TO_PROCESS_DONATION_MODAL);
        window.location.reload();
      }, 5000),
    });
  };
 
  return {
    handleOpenProcessingIssue,
  };
};