Initial implementation completion and refactor

This commit is contained in:
seavor 2026-04-11 21:18:10 -05:00
parent e977f123ce
commit f0bf865646
76 changed files with 897 additions and 890 deletions

View file

@ -1,19 +1,10 @@
import webClient from '../../WebClient';
import { BackendService } from '../../services/BackendService';
import { SessionPersistence } from '../../persistence';
export function deckDel(deckId: number): void {
const command = webClient.protobuf.controller.Command_DeckDel.create({ deckId });
const sc = webClient.protobuf.controller.SessionCommand.create({ '.Command_DeckDel.ext': command });
webClient.protobuf.sendSessionCommand(sc, raw => {
const { responseCode } = raw;
switch (responseCode) {
case webClient.protobuf.controller.Response.ResponseCode.RespOk:
SessionPersistence.deckDelete(deckId);
break;
default:
console.log('Failed to do the thing');
}
BackendService.sendSessionCommand('Command_DeckDel', { deckId }, {
onSuccess: () => {
SessionPersistence.deleteServerDeck(deckId);
},
});
}