Initial implementation completion and refactor (#6806)

This commit is contained in:
Jeremy Letto
2026-04-11 23:51:10 -04:00
committed by GitHub
parent 2e10b2f5d5
commit 8cc65b8967
76 changed files with 897 additions and 890 deletions
@@ -1,23 +1,11 @@
import webClient from '../../WebClient';
import { BackendService } from '../../services/BackendService';
import { SessionPersistence } from '../../persistence';
export function deckUpload(path: string, deckId: number, deckList: string): void {
const command = webClient.protobuf.controller.Command_DeckUpload.create({ path, deckId, deckList });
const sc = webClient.protobuf.controller.SessionCommand.create({ '.Command_DeckUpload.ext': command });
webClient.protobuf.sendSessionCommand(sc, raw => {
const { responseCode } = raw;
const response = raw['.Response_DeckUpload.ext'];
if (response) {
switch (responseCode) {
case webClient.protobuf.controller.Response.ResponseCode.RespOk:
SessionPersistence.deckUpload(response);
break;
default:
console.log('Failed to do the thing');
}
}
BackendService.sendSessionCommand('Command_DeckUpload', { path, deckId, deckList }, {
responseName: 'Response_DeckUpload',
onSuccess: (response) => {
SessionPersistence.uploadServerDeck(path, response.newFile);
},
});
}