mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-15 19:47:46 -07:00
refactor web socket layer
This commit is contained in:
parent
19f5eefdd2
commit
141f0e59f5
124 changed files with 927 additions and 853 deletions
|
|
@ -1,14 +1,18 @@
|
|||
import { create } from '@bufbuild/protobuf';
|
||||
import { BackendService } from '../../services/BackendService';
|
||||
import webClient from '../../WebClient';
|
||||
import {
|
||||
Command_GrantReplayAccess_ext, Command_GrantReplayAccessSchema,
|
||||
} from 'generated/proto/moderator_commands_pb';
|
||||
import { ModeratorPersistence } from '../../persistence';
|
||||
|
||||
export function grantReplayAccess(replayId: number, moderatorName: string): void {
|
||||
BackendService.sendModeratorCommand(Command_GrantReplayAccess_ext, create(Command_GrantReplayAccessSchema, { replayId, moderatorName }), {
|
||||
onSuccess: () => {
|
||||
ModeratorPersistence.grantReplayAccess(replayId, moderatorName);
|
||||
webClient.protobuf.sendModeratorCommand(
|
||||
Command_GrantReplayAccess_ext,
|
||||
create(Command_GrantReplayAccessSchema, { replayId, moderatorName }),
|
||||
{
|
||||
onSuccess: () => {
|
||||
ModeratorPersistence.grantReplayAccess(replayId, moderatorName);
|
||||
},
|
||||
},
|
||||
});
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue