Skip to content
This repository was archived by the owner on Feb 14, 2022. It is now read-only.

Commit 9495fd9

Browse files
committed
Fixed #24
1 parent 4b026e2 commit 9495fd9

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/content/main.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ async function initializeVoting(problemId, defaultLevel, myVote) {
105105

106106
async function addLevelIndicators() {
107107
if (isProblemPage()) {
108+
const token = await getPrefs('token')
109+
108110
const problemIdContainer = document.querySelector("ul.problem-menu li a")
109111
const problemId = problemIdContainer.innerText.replace(/[^0-9.]/g, "")
110112
const problemInfo = document.querySelector("div.page-header")
@@ -209,7 +211,7 @@ async function addLevelIndicators() {
209211
problemInfo.appendChild(difficultyVotesContainer)
210212
}
211213

212-
if (!standard || nick === "solvedac") {
214+
if (token && (!standard || nick === "solvedac")) {
213215
var defaultLevel = 1
214216
if (levelData.level) defaultLevel = levelData.level
215217
if (votedFlag) defaultLevel = myVote.voted_level

0 commit comments

Comments
 (0)