feat(FE-Storyless): update modal functionality to use show() method and clean up code

This commit is contained in:
rstubryan
2025-11-12 09:33:32 +07:00
parent fde9c449a6
commit 45f12cad4f
+1 -2
View File
@@ -16,7 +16,7 @@ export const useModal = () => {
const openModal = useCallback(() => {
if (!ref.current) return;
ref.current.showModal();
ref.current.show();
setOpen(true);
}, []);
@@ -30,7 +30,6 @@ export const useModal = () => {
open ? closeModal() : openModal();
}, [open, closeModal, openModal]);
// Gunakan useEffect agar event listener tidak didaftarkan berulang kali
useEffect(() => {
const dialog = ref.current;
if (!dialog) return;