fix: voice cell crash

This commit is contained in:
tangtaoit 2023-09-15 14:12:58 +08:00
parent b3d4aabaa5
commit 9c0c9f90f0

View File

@ -69,7 +69,9 @@ export class VoiceCell extends MessageCell<any,VoiceCellState> {
this.timeRef = React.createRef()
const { message } = props
this.content = message.content
this.waveform = Uint8Array.from(Buffer.from(this.content.waveform, "base64"))
if(this.content.waveform && this.content.waveform.length>0) {
this.waveform = new Uint8Array(atob(this.content.waveform).split('').map(char => char.charCodeAt(0)));
}
this.timeFormat = this.formatSecond(this.content.timeTrad)
}