level number updates in realtime
This commit is contained in:
parent
dd3e346313
commit
676a6abe4e
|
@ -140,7 +140,7 @@ const sync = () =>
|
||||||
|
|
||||||
// If the wanikani level differs from the local level, update the cache
|
// If the wanikani level differs from the local level, update the cache
|
||||||
if(level !== data.level)
|
if(level !== data.level)
|
||||||
updateCache(data.token, data.level, level)
|
await updateCache(data.token, data.level, level)
|
||||||
|
|
||||||
chrome.storage.local.set({"validUserLevel": true})
|
chrome.storage.local.set({"validUserLevel": true})
|
||||||
resolve("Successfully synchronized data!")
|
resolve("Successfully synchronized data!")
|
||||||
|
|
|
@ -68,6 +68,12 @@ submitButton.addEventListener( "click", () => {
|
||||||
{
|
{
|
||||||
statusField.innerHTML = String.fromCodePoint(0x2705)
|
statusField.innerHTML = String.fromCodePoint(0x2705)
|
||||||
errorField.innerHTML = ""
|
errorField.innerHTML = ""
|
||||||
|
|
||||||
|
// Update the users current WaniKani level
|
||||||
|
chrome.storage.local.get("level", (data) => {
|
||||||
|
const levelSpan = document.getElementById("level")
|
||||||
|
levelSpan.innerHTML = data.level
|
||||||
|
})
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue