mirror of
https://gitcode.com/gitea/gitea.git
synced 2025-05-28 04:47:31 +08:00
Fix remaining typescript issues, enable tsc
(#32840)
Fixes 79 typescript errors. Discovered at least two bugs in `notifications.ts`, and I'm pretty sure this feature was at least partially broken and may still be, I don't really know how to test it. After this, only like ~10 typescript errors remain in the codebase but those are harder to solve. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
@ -2,6 +2,11 @@ const sourcesByUrl = {};
|
||||
const sourcesByPort = {};
|
||||
|
||||
class Source {
|
||||
url: string;
|
||||
eventSource: EventSource;
|
||||
listening: Record<string, any>;
|
||||
clients: Array<any>;
|
||||
|
||||
constructor(url) {
|
||||
this.url = url;
|
||||
this.eventSource = new EventSource(url);
|
||||
@ -67,7 +72,7 @@ class Source {
|
||||
}
|
||||
}
|
||||
|
||||
self.addEventListener('connect', (e) => {
|
||||
self.addEventListener('connect', (e: Event & {ports: Array<any>}) => {
|
||||
for (const port of e.ports) {
|
||||
port.addEventListener('message', (event) => {
|
||||
if (!self.EventSource) {
|
||||
|
Reference in New Issue
Block a user