minor refactors and additional logs
This commit is contained in:
@ -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();
|
||||
}
|
||||
|
Reference in New Issue
Block a user