changing rate quote icon if quote was already rated. closes #1775

This commit is contained in:
Jack 2021-08-29 13:42:45 +01:00
parent 64338767b8
commit 2f76acb11a
2 changed files with 13 additions and 1 deletions

View file

@ -1593,6 +1593,18 @@ export async function finish(difficultyFailed = false) {
completedEvent.uid = firebase.auth().currentUser.uid;
if (Config.mode === "quote") {
$(".pageTest #result #rateQuoteButton .rating").text("");
let userqr = DB.getSnapshot().quoteRatings?.[randomQuote.language]?.[
randomQuote.id
];
if (userqr) {
$(".pageTest #result #rateQuoteButton .icon")
.removeClass("far")
.addClass("fas");
} else {
$(".pageTest #result #rateQuoteButton .icon")
.removeClass("fas")
.addClass("far");
}
RateQuotePopup.getQuoteStats(randomQuote).then((quoteStats) => {
if (quoteStats !== null) {
$(".pageTest #result #rateQuoteButton .rating").text(

View file

@ -1590,7 +1590,7 @@
data-balloon-pos="up"
style="display: inline-block"
>
<i class="far fa-star"></i>
<i class="icon far fa-star"></i>
<span class="rating"></span>
</span>
</div>