Skip to content

Commit 59a7a95

Browse files
committed
add a quick warning to prevent people from adding credit twice
1 parent c84d69c commit 59a7a95

File tree

2 files changed

+31
-29
lines changed

2 files changed

+31
-29
lines changed

src/packages/next/components/store/checkout.tsx

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,14 @@ export default function Checkout() {
190190
}
191191

192192
const columns = getColumns();
193+
let mode;
194+
if (completingPurchase) {
195+
mode = "completing";
196+
} else if (params == null || paymentAmount == 0) {
197+
mode = "complete";
198+
} else {
199+
mode = "add";
200+
}
193201

194202
return (
195203
<>
@@ -314,18 +322,18 @@ export default function Checkout() {
314322
}
315323
>
316324
<Icon name="credit-card" />{" "}
317-
{completingPurchase ? (
325+
{mode == "completing" && (
318326
<>
319327
Completing Purchase
320328
<Spin style={{ marginLeft: "10px" }} />
321329
</>
322-
) : params == null || paymentAmount == 0 ? (
330+
)}
331+
{mode == "complete" &&
323332
`Complete Purchase${
324333
session != null ? " (finish payment first)" : ""
325-
}`
326-
) : (
327-
`Add ${currency(paymentAmount)} credit to your account`
328-
)}
334+
}`}
335+
{mode == "add" &&
336+
`Add ${currency(paymentAmount)} credit to your account`}
329337
</Button>
330338
</div>
331339
{completingPurchase ||
@@ -336,6 +344,21 @@ export default function Checkout() {
336344
{currency(params.minPayment)}.
337345
</div>
338346
)}
347+
{mode == "add" && (
348+
<div>
349+
<b>DO NOT ADD MONEY TO COMPLETE YOUR PURCHASE TWICE:</b>{" "}
350+
<div style={{ color: "#666" }}>
351+
If you pay us, and the money doesn't immediately show up,
352+
wait a minute and refresh your browser rather than going
353+
through the entire process of paying us again. If you pay
354+
us, we will definitely receive the money, but money transfer
355+
is not always instant. Instead of just trying to pay us
356+
again, wait a little and refresh your browser or{" "}
357+
<A href="/support/new">contact us</A>. Your shopping cart
358+
contents won't be lost.
359+
</div>
360+
</div>
361+
)}
339362
</Card>
340363
</>
341364
)}

src/packages/next/pages/index.tsx

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,8 @@ export default function Home(props: Props) {
9393
<Paragraph style={{ fontSize: "11pt", margin: "15px 0" }}>
9494
{isCommercial && account && !account.is_anonymous && (
9595
<>
96-
<a
97-
href={join(basePath, "settings/licenses")}
98-
style={TOP_LINK_STYLE}
99-
>
100-
Licenses
96+
<a href={join(basePath, "store")} style={TOP_LINK_STYLE}>
97+
Store
10198
</a>{" "}
10299
<a
103100
href={join(basePath, "settings/purchases")}
@@ -130,24 +127,6 @@ export default function Home(props: Props) {
130127
)}
131128
</>
132129
)}
133-
<A href={"/config"} style={TOP_LINK_STYLE}>
134-
Config
135-
</A>{" "}
136-
{customize.shareServer && (
137-
<>
138-
<A style={TOP_LINK_STYLE} href={"/share/public_paths/page/1"}>
139-
Share
140-
</A>{" "}
141-
</>
142-
)}
143-
<>
144-
<A style={TOP_LINK_STYLE} href="/support">
145-
Support
146-
</A>{" "}
147-
<A style={TOP_LINK_STYLE} href="/info">
148-
Docs
149-
</A>
150-
</>
151130
</Paragraph>
152131
</div>
153132
);

0 commit comments

Comments
 (0)