fix: chat test overflow

This commit is contained in:
archer
2023-07-22 21:56:57 +08:00
parent e49a831cc4
commit f5fad6083a
5 changed files with 89 additions and 83 deletions

View File

@@ -64,10 +64,13 @@ const AppDetail = ({ currentTab }: { currentTab: `${TabEnum}` }) => {
);
useEffect(() => {
window.onbeforeunload = (e) => {
e.preventDefault();
e.returnValue = '内容已修改,确认离开页面吗?';
};
window.onbeforeunload =
process.env.NODE_ENV === 'production'
? (e) => {
e.preventDefault();
e.returnValue = '内容已修改,确认离开页面吗?';
}
: null;
return () => {
window.onbeforeunload = null;