level number updates in realtime

This commit is contained in:
Lauchmelder 2022-03-30 16:37:47 +02:00
parent dd3e346313
commit 676a6abe4e
No known key found for this signature in database
GPG key ID: C2403C69D78F011D
2 changed files with 7 additions and 1 deletions

View file

@ -140,7 +140,7 @@ const sync = () =>
// If the wanikani level differs from the local level, update the cache
if(level !== data.level)
updateCache(data.token, data.level, level)
await updateCache(data.token, data.level, level)
chrome.storage.local.set({"validUserLevel": true})
resolve("Successfully synchronized data!")

View file

@ -68,6 +68,12 @@ submitButton.addEventListener( "click", () => {
{
statusField.innerHTML = String.fromCodePoint(0x2705)
errorField.innerHTML = ""
// Update the users current WaniKani level
chrome.storage.local.get("level", (data) => {
const levelSpan = document.getElementById("level")
levelSpan.innerHTML = data.level
})
}
else
{