fixed quote rating api call triggering in all modes

This commit is contained in:
Jack 2021-08-27 20:41:00 +01:00
parent 2587326e82
commit ce0d7e1bac

View file

@ -1589,18 +1589,20 @@ export async function finish(difficultyFailed = false) {
) {
if (firebase.auth().currentUser != null) {
completedEvent.uid = firebase.auth().currentUser.uid;
$(".pageTest #result #rateQuoteButton .rating").text("");
RateQuotePopup.getQuoteStats(randomQuote).then((quoteStats) => {
if (quoteStats !== null) {
$(".pageTest #result #rateQuoteButton .rating").text(
quoteStats.average
);
}
$(".pageTest #result #rateQuoteButton")
.css({ opacity: 0 })
.removeClass("hidden")
.css({ opacity: 1 });
});
if (Config.mode === "quote") {
$(".pageTest #result #rateQuoteButton .rating").text("");
RateQuotePopup.getQuoteStats(randomQuote).then((quoteStats) => {
if (quoteStats !== null) {
$(".pageTest #result #rateQuoteButton .rating").text(
quoteStats.average
);
}
$(".pageTest #result #rateQuoteButton")
.css({ opacity: 0 })
.removeClass("hidden")
.css({ opacity: 1 });
});
}
//check local pb
AccountButton.loading(true);