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)
|
// search.setAttribute("list", titleList.id)
|
||||||
}
|
}
|
||||||
|
|
||||||
async onBeforeUnload(e: BeforeUnloadEvent) {
|
onBeforeUnload(e: BeforeUnloadEvent) {
|
||||||
let message = ""
|
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
|
// 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) {
|
e.returnValue = "You have unsaved changes on the current page. Are you sure you want to leave?"
|
||||||
message = "You have unsaved changes on the current page. Are you sure you want to leave?"
|
|
||||||
}
|
|
||||||
|
|
||||||
if(message) {
|
|
||||||
e.returnValue = message
|
|
||||||
return message
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
prepareTooltips(elements?: IterableIterator<HTMLElement>) {
|
prepareTooltips(elements?: IterableIterator<HTMLElement>) {
|
||||||
@ -1156,7 +1163,7 @@ export default class AnimeNotifier {
|
|||||||
|
|
||||||
async diff(url: string) {
|
async diff(url: string) {
|
||||||
if(url === this.app.currentPath) {
|
if(url === this.app.currentPath) {
|
||||||
return null
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const path = "/_" + url
|
const path = "/_" + url
|
||||||
|
@ -7,7 +7,9 @@
|
|||||||
"strict": false,
|
"strict": false,
|
||||||
"strictFunctionTypes": false,
|
"strictFunctionTypes": false,
|
||||||
"strictNullChecks": true,
|
"strictNullChecks": true,
|
||||||
|
"noImplicitReturns": true,
|
||||||
"noUnusedLocals": true,
|
"noUnusedLocals": true,
|
||||||
"noUnusedParameters": true
|
"noUnusedParameters": true,
|
||||||
|
"forceConsistentCasingInFileNames": true
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -11,7 +11,8 @@
|
|||||||
"arrow-parens": false,
|
"arrow-parens": false,
|
||||||
"trailing-comma": false,
|
"trailing-comma": false,
|
||||||
"prefer-const": true,
|
"prefer-const": true,
|
||||||
"no-var-keyword": true
|
"no-var-keyword": true,
|
||||||
|
"eofline": true
|
||||||
},
|
},
|
||||||
"rulesDirectory": []
|
"rulesDirectory": []
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user