mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-04 20:06:06 +02:00
refactor: introduce bindThis decorator to bind this automaticaly
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { Inject, Injectable } from '@nestjs/common';
|
||||
import { bindThis } from '@/decorators.js';
|
||||
import Channel from '../channel.js';
|
||||
|
||||
class AdminChannel extends Channel {
|
||||
@@ -6,6 +7,7 @@ class AdminChannel extends Channel {
|
||||
public static shouldShare = true;
|
||||
public static requireCredential = true;
|
||||
|
||||
@bindThis
|
||||
public async init(params: any) {
|
||||
// Subscribe admin stream
|
||||
this.subscriber.on(`adminStream:${this.user!.id}`, data => {
|
||||
@@ -23,6 +25,7 @@ export class AdminChannelService {
|
||||
) {
|
||||
}
|
||||
|
||||
@bindThis
|
||||
public create(id: string, connection: Channel['connection']): AdminChannel {
|
||||
return new AdminChannel(
|
||||
id,
|
||||
|
||||
Reference in New Issue
Block a user