mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-16 12:04:03 +00:00
Add eslint rule and fix as many issues as possible
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { Dispatch, SetStateAction, useCallback, useEffect, useState } from 'react';
|
||||
import { useRouter } from 'next/router';
|
||||
import { Dispatch, SetStateAction, useCallback, useEffect, useState } from "react";
|
||||
import { useRouter } from "next/router";
|
||||
|
||||
import { leaveConfirmDefaultMessage } from '@app/const';
|
||||
import { leaveConfirmDefaultMessage } from "@app/const";
|
||||
|
||||
type LeaveConfirmProps = {
|
||||
initialValue: boolean;
|
||||
@@ -43,12 +43,12 @@ export function useLeaveConfirm({
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
router.events.on('routeChangeStart', onRouteChangeStart);
|
||||
window.addEventListener('beforeunload', handleWindowClose);
|
||||
router.events.on("routeChangeStart", onRouteChangeStart);
|
||||
window.addEventListener("beforeunload", handleWindowClose);
|
||||
|
||||
return () => {
|
||||
router.events.off('routeChangeStart', onRouteChangeStart);
|
||||
window.removeEventListener('beforeunload', handleWindowClose);
|
||||
router.events.off("routeChangeStart", onRouteChangeStart);
|
||||
window.removeEventListener("beforeunload", handleWindowClose);
|
||||
};
|
||||
}, [onRouteChangeStart, handleWindowClose]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user