commit
fc43e55604
|
@ -5,4 +5,9 @@
|
|||
* Fixed error appearing right after installing extension
|
||||
|
||||
## v0.6.2
|
||||
* Added color transitions to buttons and links in the popup
|
||||
* Added color transitions to buttons and links in the popup
|
||||
|
||||
## v0.6.3
|
||||
* Startup sync check is now more consistent
|
||||
* Level number updates in realtime after sync
|
||||
* Fixed bug where internal Kanji list would get reset on sync
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "FuriKani",
|
||||
"description": "Removes furigana on websites based on your WaniKani level",
|
||||
"version": "0.6.2",
|
||||
"version": "0.6.3",
|
||||
"icons": {
|
||||
"16": "res/icon16.png",
|
||||
"48": "res/icon48.png",
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<body>
|
||||
<header>
|
||||
<h1>FuriKani</h1>
|
||||
<h2>v0.6.2</h2>
|
||||
<h2>v0.6.3</h2>
|
||||
</header>
|
||||
|
||||
<div id="token-area">
|
||||
|
|
|
@ -92,7 +92,6 @@ const updateCache = async (token, oldLevel, newLevel) => {
|
|||
|
||||
// Extract Kanji as well
|
||||
var url = "https://api.wanikani.com/v2/subjects?types=kanji&levels=" + levelURLString
|
||||
var kanji = new Set()
|
||||
|
||||
do
|
||||
{
|
||||
|
@ -131,9 +130,6 @@ const sync = () =>
|
|||
// Get user level
|
||||
level = user.data.level
|
||||
|
||||
// If the users level is somehow larger than their max allowed level, set the flag
|
||||
|
||||
|
||||
// if users level is larger than max allowed level, abort
|
||||
if(level > user.data.subscription.max_level_granted)
|
||||
{
|
||||
|
@ -141,9 +137,9 @@ const sync = () =>
|
|||
return reject("User account level exceeds account level limit")
|
||||
}
|
||||
|
||||
// If the wanikani level differs from the local leve, update the cache
|
||||
// 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!")
|
||||
|
@ -165,4 +161,6 @@ chrome.runtime.onMessage.addListener((data, sender, sendResponse) => {
|
|||
})
|
||||
|
||||
// At browser start, sync with wanikani
|
||||
sync().then(value => console.log(value)).catch(reason => {})
|
||||
chrome.runtime.onStartup.addListener(() => {
|
||||
sync().then(value => console.log(value)).catch(reason => {})
|
||||
})
|
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue