mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-16 18:04:24 +00:00
Alert on payment success or failure. (#1705)
## Description: Alert on payment success or failure. ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I process any text displayed to the user through translateText() and I've added it to the en.json file - [x] I have added relevant tests to the test directory - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced - [x] I have read and accepted the CLA agreement (only required once). ## Please put your Discord username so you can be contacted if a bug or regression is found: evan
This commit is contained in:
@@ -423,8 +423,25 @@ class Client {
|
||||
|
||||
private handleHash() {
|
||||
const { hash } = window.location;
|
||||
|
||||
const alertAndStrip = (message: string) => {
|
||||
alert(message);
|
||||
history.replaceState(
|
||||
null,
|
||||
"",
|
||||
window.location.pathname + window.location.search,
|
||||
);
|
||||
};
|
||||
|
||||
if (hash.startsWith("#")) {
|
||||
const params = new URLSearchParams(hash.slice(1));
|
||||
if (params.get("purchase-completed") === "true") {
|
||||
alertAndStrip("purchase succeeded");
|
||||
return;
|
||||
} else if (params.get("purchase-completed") === "false") {
|
||||
alertAndStrip("purchase failed");
|
||||
return;
|
||||
}
|
||||
const lobbyId = params.get("join");
|
||||
if (lobbyId && ID.safeParse(lobbyId).success) {
|
||||
this.joinModal.open(lobbyId);
|
||||
|
||||
Reference in New Issue
Block a user