mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2024-11-10 17:04:49 +08:00
changing rate quote icon if quote was already rated. closes #1775
This commit is contained in:
parent
64338767b8
commit
2f76acb11a
2 changed files with 13 additions and 1 deletions
|
@ -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(
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue