Use const variables when applicable

This commit is contained in:
2019-11-17 18:25:14 +09:00
parent 454e8572e3
commit 878f1913e3
39 changed files with 405 additions and 403 deletions

View File

@ -13,8 +13,8 @@ export async function unfollowUser(arn: AnimeNotifier, element: HTMLElement) {
// Update follow
async function updateFollow(arn: AnimeNotifier, element: HTMLElement, message: string) {
let api = element.dataset.api
let nick = document.getElementById("nick")
const api = element.dataset.api
const nick = document.getElementById("nick")
if(!api || !nick || !nick.textContent) {
console.error("Missing data-api or invalid nick:", element)
@ -34,7 +34,7 @@ async function updateFollow(arn: AnimeNotifier, element: HTMLElement, message: s
export function showMore(_: AnimeNotifier, showMoreElement: HTMLElement) {
const elements = [...document.getElementsByClassName("show-more")]
for(let element of elements) {
for(const element of elements) {
Diff.mutations.queue(() => element.classList.remove("show-more"))
}