From 3a8efd59185e419caa94366041b9f500f64deaa8 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Mon, 29 Jul 2019 11:28:13 -0700 Subject: [PATCH] fix crash leaving payments pagge by not returning a promise in useEffect call --- src/Payments/PrivateKeys.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/Payments/PrivateKeys.js b/src/Payments/PrivateKeys.js index 70a6b930..fa5ca942 100644 --- a/src/Payments/PrivateKeys.js +++ b/src/Payments/PrivateKeys.js @@ -38,14 +38,13 @@ const PrivateKeys = () => { } }, 5000); - useEffect( - () => - (async () => { - const wgPublicKey = await get("/wg_public_key"); - if (!(wgPublicKey instanceof Error)) setOldKey(wgPublicKey); - })(), - [] - ); + useEffect(() => { + (async () => { + const wgPublicKey = await get("/wg_public_key"); + if (!(wgPublicKey instanceof Error)) setOldKey(wgPublicKey); + })(); + return; + }, []); const save = async e => { e.preventDefault();