Created
June 17, 2024 15:03
-
-
Save Steffo99/ad2781a1b3989ef9528ce55dad51b20a to your computer and use it in GitHub Desktop.
Add a color to yourself on Akkoma
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const YOUR_USERNAME = "steffo" | |
const DESIRED_COLOR = "#1a5fb4" | |
const DESIRED_STYLE = "solid" | |
const request = indexedDB.open("localforage"); | |
request.onsuccess = (event) => { | |
const db = event.target.result; | |
const transaction = db.transaction(["keyvaluepairs"], "readwrite"); | |
const kvp = transaction.objectStore("keyvaluepairs"); | |
const kvprequest = kvp.get("vuex-lz"); | |
kvprequest.onsuccess = (event) => { | |
const data = event.target.result | |
data["config"]["highlight"][YOUR_USERNAME] = { | |
color: DESIRED_COLOR, | |
type: DESIRED_STYLE, | |
} | |
const kvpupdate = kvp.put(data, "vuex-lz"); | |
kvpupdate.onsuccess = (event) => { | |
console.info("Success!", event) | |
} | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment