minor refactors and additional logs

This commit is contained in:
2024-09-24 14:47:50 +02:00
parent 498b1d82d9
commit d39ccba927
4 changed files with 25 additions and 10 deletions

View File

@ -224,7 +224,7 @@ export class TimelineReader {
accountUrl: accountUrl,
file: fn,
sizeDescriptor: `${i}x`
} as AccountAvatar)
}) as AccountAvatar
)
.then(saveAvatar)
)
@ -261,7 +261,7 @@ export class TimelineReader {
file: fn,
sizeDescriptor: `${i}x`,
kind: kind
} as SongThumbnailImage)
}) as SongThumbnailImage
)
.then(saveSongThumbnail)
)
@ -363,6 +363,7 @@ export class TimelineReader {
try {
const data: TimelineEvent = JSON.parse(event.data.toString());
if (data.event !== 'update') {
log.log('Ignoring ES event', data.event);
return;
}
const post: Post = JSON.parse(data.payload);
@ -410,10 +411,12 @@ export class TimelineReader {
}
private constructor() {
log.log('Constructing timeline object');
this.startWebsocket();
}
public static init() {
log.log('Timeline object init');
if (this._instance === undefined) {
this._instance = new TimelineReader();
}