Skip to content

Commit

Permalink
Fix sendwire url
Browse files Browse the repository at this point in the history
  • Loading branch information
jkilpatr committed Apr 23, 2020
1 parent 91eb442 commit aea63f2
Showing 1 changed file with 22 additions and 14 deletions.
36 changes: 22 additions & 14 deletions src/Deposit.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,27 @@ const Deposit = ({ open, setOpen }) => {
const [wyreAccountId, setWyreAccountId] = useState();

const [
{ address, debt, lowBalance, status, withdrawChainSymbol }
{ address, debt, lowBalance, status, withdrawChainSymbol },
] = useStore();

const getWyreEnabled = useCallback(async signal => {
try {
const { wyreEnabled, wyreAccountId } = await get("/localization", true, 5000, signal)
setWyreEnabled(wyreEnabled);
setWyreAccountId(wyreAccountId);
if (wyreEnabled && withdrawChainSymbol === "ETH") setDepositing(false);
} catch {}

setLoading(false);
}, [withdrawChainSymbol]);
const getWyreEnabled = useCallback(
async (signal) => {
try {
const { wyreEnabled, wyreAccountId } = await get(
"/localization",
true,
5000,
signal
);
setWyreEnabled(wyreEnabled);
setWyreAccountId(wyreAccountId);
if (wyreEnabled && withdrawChainSymbol === "ETH") setDepositing(false);
} catch {}

setLoading(false);
},
[withdrawChainSymbol]
);

useEffect(
() => {
Expand Down Expand Up @@ -58,7 +66,7 @@ const Deposit = ({ open, setOpen }) => {
const toggle = () => {
setOpen(!open);
if (wyreEnabled && withdrawChainSymbol === "ETH") setDepositing(false);
}
};

const copy = () => {
setCopied(true);
Expand All @@ -77,7 +85,7 @@ const Deposit = ({ open, setOpen }) => {
"https://pay.sendwyre.com/purchase" +
`?dest=${address}` +
"&destCurrency=ETH" +
`&account_id=${wyreAccountId}` +
`&accountId=${wyreAccountId}` +
`&redirectUrl=${
window.isMobile ? "althea://" : window.location.href
}`
Expand Down Expand Up @@ -107,7 +115,7 @@ const Deposit = ({ open, setOpen }) => {
style={{
border: "1px solid #ddd",
borderRadius: 5,
wordWrap: "break-word"
wordWrap: "break-word",
}}
>
<div className="d-flex py-2 px-0 w-100">
Expand Down

0 comments on commit aea63f2

Please sign in to comment.