Use MessageChannels to self-delete queue items
Previous method would cause site to die
This commit is contained in:
@ -21,7 +21,7 @@ import {
|
||||
} from "@chakra-ui/react";
|
||||
import { useEffect, useState } from "react";
|
||||
|
||||
export default function(props: AppealCardProps) {
|
||||
export default function(props: AppealCardProps & { port?: MessagePort }) {
|
||||
const [dateString, setDateString] = useState(
|
||||
new Date(props.created_at).toUTCString()
|
||||
);
|
||||
@ -80,7 +80,7 @@ export default function(props: AppealCardProps) {
|
||||
|
||||
onClose();
|
||||
setLoading(false);
|
||||
document.getElementById(`appeal_${props.id}`)?.remove();
|
||||
props.port?.postMessage(`appeal_${props.id}`);
|
||||
}
|
||||
|
||||
return (
|
||||
|
Reference in New Issue
Block a user