mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
refactor typescript wiring
This commit is contained in:
parent
cea9ae62d8
commit
c62c336a11
286 changed files with 2999 additions and 3053 deletions
|
|
@ -1,12 +1,17 @@
|
|||
import { create } from '@bufbuild/protobuf';
|
||||
import webClient from '../../WebClient';
|
||||
import { Command_ReplayModifyMatchSchema, Command_ReplayModifyMatch_ext } from 'generated/proto/command_replay_modify_match_pb';
|
||||
|
||||
import { SessionPersistence } from '../../persistence';
|
||||
import { Data } from '@app/types';
|
||||
|
||||
export function replayModifyMatch(gameId: number, doNotHide: boolean): void {
|
||||
webClient.protobuf.sendSessionCommand(Command_ReplayModifyMatch_ext, create(Command_ReplayModifyMatchSchema, { gameId, doNotHide }), {
|
||||
onSuccess: () => {
|
||||
SessionPersistence.replayModifyMatch(gameId, doNotHide);
|
||||
},
|
||||
});
|
||||
webClient.protobuf.sendSessionCommand(
|
||||
Data.Command_ReplayModifyMatch_ext,
|
||||
create(Data.Command_ReplayModifyMatchSchema, { gameId, doNotHide }),
|
||||
{
|
||||
onSuccess: () => {
|
||||
SessionPersistence.replayModifyMatch(gameId, doNotHide);
|
||||
},
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue