refactor redux data model

This commit is contained in:
seavor 2026-04-15 21:48:03 -05:00
parent ae1bc3da38
commit 0ff391491d
243 changed files with 5212 additions and 5963 deletions

View file

@ -1,16 +1,19 @@
import { create } from '@bufbuild/protobuf';
import webClient from '../../WebClient';
import { WebClient } from '../../WebClient';
import { SessionPersistence } from '../../persistence';
import { Data } from '@app/types';
export function deckUpload(path: string, deckId: number, deckList: string): void {
webClient.protobuf.sendSessionCommand(Data.Command_DeckUpload_ext, create(Data.Command_DeckUploadSchema, { path, deckId, deckList }), {
responseExt: Data.Response_DeckUpload_ext,
onSuccess: (response) => {
if (response.newFile) {
SessionPersistence.uploadServerDeck(path, response.newFile);
}
},
});
WebClient.instance.protobuf.sendSessionCommand(
Data.Command_DeckUpload_ext,
create(Data.Command_DeckUploadSchema, { path, deckId, deckList }),
{
responseExt: Data.Response_DeckUpload_ext,
onSuccess: (response) => {
if (response.newFile) {
WebClient.instance.response.session.uploadServerDeck(path, response.newFile);
}
},
}
);
}