Add few more interfaces (#5063)

This commit is contained in:
Zach H 2024-06-25 01:00:45 -04:00 committed by GitHub
parent e261e16d99
commit 8687163cca
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
34 changed files with 359 additions and 90 deletions

View file

@ -0,0 +1,23 @@
import webClient from '../../WebClient';
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');
}
}
});
}