Skip to content

Commit

Permalink
fix(crux): add return type back
Browse files Browse the repository at this point in the history
  • Loading branch information
robot9706 committed Sep 18, 2023
1 parent 920a670 commit 8a2b34a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion web/crux/src/app/config.bundle/config.bundle.ws.gateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export default class ConfigBundleWebSocketGateway {
@SocketClient() client: WsClient,
@ConfigBundleId() configBundleId: string,
@SocketSubscription() subscription: WsSubscription,
) {
): Promise<void> {
const data = await this.service.onEditorLeft(configBundleId, client.token)
const message: WsMessage<EditorLeftMessage> = {
type: WS_TYPE_EDITOR_LEFT,
Expand Down
2 changes: 1 addition & 1 deletion web/crux/src/app/deploy/deploy.ws.gateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export default class DeployWebSocketGateway {
@SocketClient() client: WsClient,
@DeploymentId() deploymentId: string,
@SocketSubscription() subscription: WsSubscription,
) {
): Promise<void> {
const data = await this.service.onEditorLeft(deploymentId, client.token)
const message: WsMessage<EditorLeftMessage> = {
type: WS_TYPE_EDITOR_LEFT,
Expand Down
4 changes: 2 additions & 2 deletions web/crux/src/app/token/jwt-auth.guard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default class JwtAuthGuard extends AuthGuard('jwt') {
return await this.canActivateHttp(context, context.switchToHttp().getRequest(), strategy)
}
if (type === 'ws') {
return await this.canActivateWs(context)
return this.canActivateWs(context)
}

this.logger.error(`Invalid context ${type}`)
Expand Down Expand Up @@ -107,7 +107,7 @@ export default class JwtAuthGuard extends AuthGuard('jwt') {
req.headers.authorization = `Bearer ${token}`
}

private async canActivateWs(context: ExecutionContext): Promise<boolean> {
private canActivateWs(context: ExecutionContext) {
const client: WsClient = context.switchToWs().getClient()
const message = this.reflector.get('message', context.getHandler())
if (client.disconnecting) {
Expand Down
2 changes: 1 addition & 1 deletion web/crux/src/app/version/version.ws.gateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export default class VersionWebSocketGateway {
@SocketClient() client: WsClient,
@VersionId() versionId: string,
@SocketSubscription() subscription: WsSubscription,
) {
): Promise<void> {
const data = await this.service.onEditorLeft(versionId, client.token)
const message: WsMessage<EditorLeftMessage> = {
type: WS_TYPE_EDITOR_LEFT,
Expand Down

0 comments on commit 8a2b34a

Please sign in to comment.