fix(ui): fix assist backwards compat for messages
This commit is contained in:
parent
36aa45206c
commit
16186c3786
4 changed files with 5 additions and 5 deletions
|
|
@ -172,7 +172,8 @@ export default class AssistManager {
|
|||
|
||||
socket.on('messages', messages => {
|
||||
const isOldVersion = messages.meta.version === 1
|
||||
this.assistVersion = messages.meta.version
|
||||
this.assistVersion = isOldVersion ? 1 : 2
|
||||
|
||||
const data = messages.data || messages
|
||||
jmr.append(data) // as RawMessage[]
|
||||
if (waitingForMessages) {
|
||||
|
|
|
|||
|
|
@ -237,6 +237,7 @@ export default class Call {
|
|||
console.warn('No tab data to connect to peer')
|
||||
}
|
||||
const peerId = this.getAssistVersion() === 1 ? this.peerID : `${this.peerID}-${tab || Object.keys(this.store.get().tabs)[0]}`
|
||||
console.log(peerId, this.getAssistVersion())
|
||||
void this._peerConnection(peerId);
|
||||
this.emitData("_agent_name", appStore.getState().getIn([ 'user', 'account', 'name']))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ export default class RemoteControl {
|
|||
}
|
||||
|
||||
private emitData = (event: string, data?: any) => {
|
||||
if (this.getAssistVersion()) {
|
||||
if (this.getAssistVersion() === 1) {
|
||||
this.socket.emit(event, data)
|
||||
} else {
|
||||
this.socket.emit(event, { meta: { tabId: this.store.get().currentTab }, data })
|
||||
|
|
|
|||
|
|
@ -37,8 +37,6 @@ export default class ScreenRecording {
|
|||
socket.on('recording_busy', () => {
|
||||
this.onRecordingBusy()
|
||||
})
|
||||
|
||||
this.assistVersion = getAssistVersion()
|
||||
}
|
||||
|
||||
private onRecordingBusy = () => {
|
||||
|
|
@ -59,7 +57,7 @@ export default class ScreenRecording {
|
|||
}
|
||||
|
||||
private emitData = (event: string, data?: any) => {
|
||||
if (this.assistVersion === 1) {
|
||||
if (this.getAssistVersion() === 1) {
|
||||
this.socket.emit(event, data)
|
||||
} else {
|
||||
this.socket.emit(event, { meta: { tabId: this.store.get().currentTab }, data })
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue