From 6d57c3d2154c3b0d5a36e20f1fcb46a12f0dcc0b Mon Sep 17 00:00:00 2001 From: GRZ4NA Date: Mon, 4 Oct 2021 00:25:23 +0200 Subject: [PATCH] added the ability to return a value from popup --- src/utils/spawnPopup.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/spawnPopup.js b/src/utils/spawnPopup.js index 2f4355e..3bb221b 100644 --- a/src/utils/spawnPopup.js +++ b/src/utils/spawnPopup.js @@ -3,7 +3,7 @@ import { Window } from "../components/Window"; import { window as windowStyles } from "../components/Window/index.module.scss"; const closeWindow = (resolver) => { - return () => { + return (value) => { document.getElementsByClassName(windowStyles)[0].animate( [ { transform: "scale(1)", opacity: 1 }, @@ -17,7 +17,7 @@ const closeWindow = (resolver) => { setTimeout(() => { ReactDOM.unmountComponentAtNode(document.getElementById("popup-container")); document.getElementById("popup-container").style.display = "none"; - resolver(); + resolver(value); }, 300); }; };