mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-24 14:56:23 +08:00
reordered lines
This commit is contained in:
parent
59fa77fe18
commit
45948de9be
1 changed files with 16 additions and 7 deletions
|
|
@ -1274,8 +1274,10 @@ export async function retrySavingResult(): Promise<void> {
|
|||
Result.hideCrown();
|
||||
|
||||
if (response.status !== 200) {
|
||||
console.log("Error saving result", completedEvent);
|
||||
retrySaving.canRetry = true;
|
||||
$("#retrySavingResultButton").removeClass("hidden");
|
||||
retrySaving.completedEvent = completedEvent;
|
||||
return Notifications.add("Result not saved. " + response.message, -1);
|
||||
}
|
||||
|
||||
|
|
@ -1323,6 +1325,17 @@ export async function retrySavingResult(): Promise<void> {
|
|||
);
|
||||
}
|
||||
|
||||
if (response.data.dailyLeaderboardRank) {
|
||||
Notifications.add(
|
||||
`New ${completedEvent.language} ${completedEvent.mode} ${completedEvent.mode2} rank: ` +
|
||||
Misc.getPositionString(response.data.dailyLeaderboardRank),
|
||||
1,
|
||||
10,
|
||||
"Daily Leaderboard",
|
||||
"list-ol"
|
||||
);
|
||||
}
|
||||
|
||||
$("#retrySavingResultButton").addClass("hidden");
|
||||
Notifications.add("Result saved", 1);
|
||||
}
|
||||
|
|
@ -1678,15 +1691,13 @@ export async function finish(difficultyFailed = false): Promise<void> {
|
|||
const response = await Ape.results.save(completedEvent);
|
||||
|
||||
AccountButton.loading(false);
|
||||
Result.hideCrown();
|
||||
|
||||
if (response.status !== 200) {
|
||||
console.log("Error saving result", completedEvent);
|
||||
$("#retrySavingResultButton").removeClass("hidden");
|
||||
if (response.message === "Incorrect result hash") {
|
||||
console.log(completedEvent);
|
||||
}
|
||||
retrySaving.completedEvent = completedEvent;
|
||||
retrySaving.canRetry = true;
|
||||
$("#retrySavingResultButton").removeClass("hidden");
|
||||
retrySaving.completedEvent = completedEvent;
|
||||
return Notifications.add("Failed to save result: " + response.message, -1);
|
||||
}
|
||||
|
||||
|
|
@ -1701,8 +1712,6 @@ export async function finish(difficultyFailed = false): Promise<void> {
|
|||
DB.addXp(response.data.xp);
|
||||
}
|
||||
|
||||
Result.hideCrown();
|
||||
|
||||
completedEvent._id = response.data.insertedId;
|
||||
if (response.data.isPb) {
|
||||
completedEvent.isPb = true;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue