chore: prevent unexpected variable scope leaks
This commit is contained in:
parent
bedf4cb791
commit
e143f0d7ac
1 changed files with 4 additions and 2 deletions
|
@ -48,7 +48,7 @@ export class MastodonStreamUser extends MastodonStream {
|
|||
if (!(await this.shouldProcessNote(note))) return;
|
||||
|
||||
switch (data.type) {
|
||||
case "updated":
|
||||
case "updated": {
|
||||
const encoded = await NoteConverter.encodeEvent(
|
||||
note,
|
||||
this.user,
|
||||
|
@ -56,6 +56,7 @@ export class MastodonStreamUser extends MastodonStream {
|
|||
);
|
||||
this.connection.send(this.chName, "status.update", encoded);
|
||||
break;
|
||||
}
|
||||
case "deleted":
|
||||
this.connection.send(this.chName, "delete", note.id);
|
||||
break;
|
||||
|
@ -66,7 +67,7 @@ export class MastodonStreamUser extends MastodonStream {
|
|||
|
||||
private async onUserEvent(data: StreamMessages["main"]["payload"]) {
|
||||
switch (data.type) {
|
||||
case "notification":
|
||||
case "notification": {
|
||||
const encoded = await NotificationConverter.encodeEvent(
|
||||
data.body.id,
|
||||
this.user,
|
||||
|
@ -74,6 +75,7 @@ export class MastodonStreamUser extends MastodonStream {
|
|||
);
|
||||
if (encoded) this.connection.send(this.chName, "notification", encoded);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue