Fixed a few more linter errors
This commit is contained in:
parent
878f1913e3
commit
7e25ee6faf
@ -310,18 +310,25 @@ export default class AnimeNotifier {
|
||||
// search.setAttribute("list", titleList.id)
|
||||
}
|
||||
|
||||
async onBeforeUnload(e: BeforeUnloadEvent) {
|
||||
let message = ""
|
||||
onBeforeUnload(e: BeforeUnloadEvent) {
|
||||
if(this.app.currentPath !== "/new/thread") {
|
||||
return
|
||||
}
|
||||
|
||||
if(!document.activeElement) {
|
||||
return
|
||||
}
|
||||
|
||||
if(document.activeElement.tagName !== "TEXTAREA") {
|
||||
return
|
||||
}
|
||||
|
||||
if((document.activeElement as HTMLTextAreaElement).value.length < 20) {
|
||||
return
|
||||
}
|
||||
|
||||
// Prevent closing tab on new thread page
|
||||
if(this.app.currentPath === "/new/thread" && document.activeElement && document.activeElement.tagName === "TEXTAREA" && (document.activeElement as HTMLTextAreaElement).value.length > 20) {
|
||||
message = "You have unsaved changes on the current page. Are you sure you want to leave?"
|
||||
}
|
||||
|
||||
if(message) {
|
||||
e.returnValue = message
|
||||
return message
|
||||
}
|
||||
e.returnValue = "You have unsaved changes on the current page. Are you sure you want to leave?"
|
||||
}
|
||||
|
||||
prepareTooltips(elements?: IterableIterator<HTMLElement>) {
|
||||
@ -1156,7 +1163,7 @@ export default class AnimeNotifier {
|
||||
|
||||
async diff(url: string) {
|
||||
if(url === this.app.currentPath) {
|
||||
return null
|
||||
return
|
||||
}
|
||||
|
||||
const path = "/_" + url
|
||||
|
@ -7,7 +7,9 @@
|
||||
"strict": false,
|
||||
"strictFunctionTypes": false,
|
||||
"strictNullChecks": true,
|
||||
"noImplicitReturns": true,
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true
|
||||
"noUnusedParameters": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
}
|
||||
}
|
@ -11,7 +11,8 @@
|
||||
"arrow-parens": false,
|
||||
"trailing-comma": false,
|
||||
"prefer-const": true,
|
||||
"no-var-keyword": true
|
||||
"no-var-keyword": true,
|
||||
"eofline": true
|
||||
},
|
||||
"rulesDirectory": []
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user