Skip to content

Commit f1f08f9

Browse files
committed
Remove leave page blocker
1 parent 76cb242 commit f1f08f9

1 file changed

Lines changed: 0 additions & 15 deletions

File tree

src/app/pages/SettingPage.tsx

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { useBlocker } from '@tanstack/react-router'
2-
import { motion } from 'framer-motion'
31
import { FC, PropsWithChildren, useCallback, useEffect, useState } from 'react'
42
import toast, { Toaster } from 'react-hot-toast'
53
import { useTranslation } from 'react-i18next'
@@ -99,19 +97,6 @@ function SettingPage() {
9997
setTimeout(() => location.reload(), 500)
10098
}, [userConfig])
10199

102-
useBlocker(t('You have unsaved changes, are you sure you want to leave?'), dirty)
103-
104-
useEffect(() => {
105-
const listener = (e: Event) => {
106-
if (dirty) {
107-
e.preventDefault()
108-
e.returnValue = false
109-
}
110-
}
111-
window.addEventListener('beforeunload', listener)
112-
return () => window.removeEventListener('beforeunload', listener)
113-
}, [dirty])
114-
115100
if (!userConfig) {
116101
return null
117102
}

0 commit comments

Comments
 (0)