mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
fix memory leak
This commit is contained in:
@@ -130,13 +130,20 @@ const ModerationModal = ({ isOpen, closeModal, deletePost }) => {
|
|||||||
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
let isActive = true;
|
||||||
if (publishCommentEditOptions && triggerPublishCommentEdit) {
|
if (publishCommentEditOptions && triggerPublishCommentEdit) {
|
||||||
(async () => {
|
(async () => {
|
||||||
await publishCommentEdit();
|
await publishCommentEdit();
|
||||||
|
if (isActive) {
|
||||||
setTriggerPublishCommentEdit(false);
|
setTriggerPublishCommentEdit(false);
|
||||||
|
}
|
||||||
})();
|
})();
|
||||||
}
|
}
|
||||||
}, [publishCommentEditOptions, triggerPublishCommentEdit, publishCommentEdit]);
|
|
||||||
|
return () => {
|
||||||
|
isActive = false;
|
||||||
|
};
|
||||||
|
}, [triggerPublishCommentEdit, publishCommentEdit, publishCommentEditOptions]);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -416,13 +416,20 @@ const All = () => {
|
|||||||
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
let isActive = true;
|
||||||
if (publishCommentEditOptions && triggerPublishCommentEdit) {
|
if (publishCommentEditOptions && triggerPublishCommentEdit) {
|
||||||
(async () => {
|
(async () => {
|
||||||
await publishCommentEdit();
|
await publishCommentEdit();
|
||||||
|
if (isActive) {
|
||||||
setTriggerPublishCommentEdit(false);
|
setTriggerPublishCommentEdit(false);
|
||||||
|
}
|
||||||
})();
|
})();
|
||||||
}
|
}
|
||||||
}, [publishCommentEditOptions, triggerPublishCommentEdit, publishCommentEdit]);
|
|
||||||
|
return () => {
|
||||||
|
isActive = false;
|
||||||
|
};
|
||||||
|
}, [triggerPublishCommentEdit, publishCommentEdit, publishCommentEditOptions]);
|
||||||
|
|
||||||
// desktop navbar board select functionality
|
// desktop navbar board select functionality
|
||||||
const handleClickTitle = (title, address) => {
|
const handleClickTitle = (title, address) => {
|
||||||
|
|||||||
@@ -278,13 +278,20 @@ const AllCatalog = () => {
|
|||||||
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
let isActive = true;
|
||||||
if (publishCommentEditOptions && triggerPublishCommentEdit) {
|
if (publishCommentEditOptions && triggerPublishCommentEdit) {
|
||||||
(async () => {
|
(async () => {
|
||||||
await publishCommentEdit();
|
await publishCommentEdit();
|
||||||
|
if (isActive) {
|
||||||
setTriggerPublishCommentEdit(false);
|
setTriggerPublishCommentEdit(false);
|
||||||
|
}
|
||||||
})();
|
})();
|
||||||
}
|
}
|
||||||
}, [publishCommentEditOptions, triggerPublishCommentEdit, publishCommentEdit]);
|
|
||||||
|
return () => {
|
||||||
|
isActive = false;
|
||||||
|
};
|
||||||
|
}, [triggerPublishCommentEdit, publishCommentEdit, publishCommentEditOptions]);
|
||||||
|
|
||||||
|
|
||||||
// mobile navbar board select functionality
|
// mobile navbar board select functionality
|
||||||
|
|||||||
@@ -546,13 +546,21 @@ const Board = () => {
|
|||||||
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
let isActive = true;
|
||||||
if (publishCommentEditOptions && triggerPublishCommentEdit) {
|
if (publishCommentEditOptions && triggerPublishCommentEdit) {
|
||||||
(async () => {
|
(async () => {
|
||||||
await publishCommentEdit();
|
await publishCommentEdit();
|
||||||
|
if (isActive) {
|
||||||
setTriggerPublishCommentEdit(false);
|
setTriggerPublishCommentEdit(false);
|
||||||
|
}
|
||||||
})();
|
})();
|
||||||
}
|
}
|
||||||
}, [publishCommentEditOptions, triggerPublishCommentEdit, publishCommentEdit]);
|
|
||||||
|
return () => {
|
||||||
|
isActive = false;
|
||||||
|
};
|
||||||
|
}, [triggerPublishCommentEdit, publishCommentEdit, publishCommentEditOptions]);
|
||||||
|
|
||||||
|
|
||||||
// desktop navbar board select functionality
|
// desktop navbar board select functionality
|
||||||
const handleClickTitle = (title, address) => {
|
const handleClickTitle = (title, address) => {
|
||||||
|
|||||||
@@ -418,13 +418,20 @@ const Subscriptions = () => {
|
|||||||
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
let isActive = true;
|
||||||
if (publishCommentEditOptions && triggerPublishCommentEdit) {
|
if (publishCommentEditOptions && triggerPublishCommentEdit) {
|
||||||
(async () => {
|
(async () => {
|
||||||
await publishCommentEdit();
|
await publishCommentEdit();
|
||||||
|
if (isActive) {
|
||||||
setTriggerPublishCommentEdit(false);
|
setTriggerPublishCommentEdit(false);
|
||||||
|
}
|
||||||
})();
|
})();
|
||||||
}
|
}
|
||||||
}, [publishCommentEditOptions, triggerPublishCommentEdit, publishCommentEdit]);
|
|
||||||
|
return () => {
|
||||||
|
isActive = false;
|
||||||
|
};
|
||||||
|
}, [triggerPublishCommentEdit, publishCommentEdit, publishCommentEditOptions]);
|
||||||
|
|
||||||
// desktop navbar board select functionality
|
// desktop navbar board select functionality
|
||||||
const handleClickTitle = (title, address) => {
|
const handleClickTitle = (title, address) => {
|
||||||
|
|||||||
@@ -275,13 +275,20 @@ const SubscriptionsCatalog = () => {
|
|||||||
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
let isActive = true;
|
||||||
if (publishCommentEditOptions && triggerPublishCommentEdit) {
|
if (publishCommentEditOptions && triggerPublishCommentEdit) {
|
||||||
(async () => {
|
(async () => {
|
||||||
await publishCommentEdit();
|
await publishCommentEdit();
|
||||||
|
if (isActive) {
|
||||||
setTriggerPublishCommentEdit(false);
|
setTriggerPublishCommentEdit(false);
|
||||||
|
}
|
||||||
})();
|
})();
|
||||||
}
|
}
|
||||||
}, [publishCommentEditOptions, triggerPublishCommentEdit, publishCommentEdit]);
|
|
||||||
|
return () => {
|
||||||
|
isActive = false;
|
||||||
|
};
|
||||||
|
}, [triggerPublishCommentEdit, publishCommentEdit, publishCommentEditOptions]);
|
||||||
|
|
||||||
// desktop navbar board select functionality
|
// desktop navbar board select functionality
|
||||||
const handleClickTitle = (title, address) => {
|
const handleClickTitle = (title, address) => {
|
||||||
|
|||||||
@@ -509,13 +509,20 @@ const Thread = () => {
|
|||||||
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
let isActive = true;
|
||||||
if (publishCommentEditOptions && triggerPublishCommentEdit) {
|
if (publishCommentEditOptions && triggerPublishCommentEdit) {
|
||||||
(async () => {
|
(async () => {
|
||||||
await publishCommentEdit();
|
await publishCommentEdit();
|
||||||
|
if (isActive) {
|
||||||
setTriggerPublishCommentEdit(false);
|
setTriggerPublishCommentEdit(false);
|
||||||
|
}
|
||||||
})();
|
})();
|
||||||
}
|
}
|
||||||
}, [publishCommentEditOptions, triggerPublishCommentEdit, publishCommentEdit]);
|
|
||||||
|
return () => {
|
||||||
|
isActive = false;
|
||||||
|
};
|
||||||
|
}, [triggerPublishCommentEdit, publishCommentEdit, publishCommentEditOptions]);
|
||||||
|
|
||||||
// mobile navbar board select functionality
|
// mobile navbar board select functionality
|
||||||
const handleSelectChange = (event) => {
|
const handleSelectChange = (event) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user