Skip to content

Commit

Permalink
fix crash leaving payments pagge by not returning a promise in useEff…
Browse files Browse the repository at this point in the history
…ect call
  • Loading branch information
asoltys committed Jul 29, 2019
1 parent d1130c4 commit 3a8efd5
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/Payments/PrivateKeys.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 3a8efd5

Please sign in to comment.