fix
This commit is contained in:
parent
84ee279b35
commit
8bca7cb7db
2 changed files with 6 additions and 6 deletions
|
|
@ -62,7 +62,7 @@ export class TlvStorageFactory extends EventEmitter {
|
|||
|
||||
async LoadLatest(storageName: string, limit?: number): Promise<LatestData> {
|
||||
const opId = Math.random().toString()
|
||||
const op: LoadLatestTlvOperation = { type: 'loadLatestTlv', opId, storageName, limit, debug: true }
|
||||
const op: LoadLatestTlvOperation = { type: 'loadLatest', opId, storageName, limit, debug: true }
|
||||
const latestData = await this.handleOp<SerializableLatestData>(op)
|
||||
const deserializedLatestData: LatestData = {}
|
||||
for (const appId in latestData) {
|
||||
|
|
@ -76,7 +76,7 @@ export class TlvStorageFactory extends EventEmitter {
|
|||
|
||||
async LoadFile(storageName: string, appId: string, dataName: string, chunk: number): Promise<TlvFile> {
|
||||
const opId = Math.random().toString()
|
||||
const op: LoadTlvFileOperation = { type: 'loadTlvFile', opId, storageName, appId, dataName, chunk, debug: true }
|
||||
const op: LoadTlvFileOperation = { type: 'loadFile', opId, storageName, appId, dataName, chunk, debug: true }
|
||||
const tlvFile = await this.handleOp<SerializableTlvFile>(op)
|
||||
return { fileData: Buffer.from(tlvFile.base64fileData, 'base64'), chunks: tlvFile.chunks }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ export type AddTlvOperation = {
|
|||
}
|
||||
|
||||
export type LoadLatestTlvOperation = {
|
||||
type: 'loadLatestTlv'
|
||||
type: 'loadLatest'
|
||||
opId: string
|
||||
storageName: string
|
||||
limit?: number
|
||||
|
|
@ -33,7 +33,7 @@ export type LoadLatestTlvOperation = {
|
|||
}
|
||||
|
||||
export type LoadTlvFileOperation = {
|
||||
type: 'loadTlvFile'
|
||||
type: 'loadFile'
|
||||
opId: string
|
||||
storageName: string
|
||||
appId: string
|
||||
|
|
@ -82,10 +82,10 @@ class TlvFilesStorageProcessor {
|
|||
case 'addTlv':
|
||||
await this.handleAddTlv(operation);
|
||||
break;
|
||||
case 'loadLatestTlv':
|
||||
case 'loadLatest':
|
||||
await this.handleLoadLatestTlv(operation);
|
||||
break;
|
||||
case 'loadTlvFile':
|
||||
case 'loadFile':
|
||||
await this.handleLoadTlvFile(operation);
|
||||
break;
|
||||
default:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue