Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions apps/remix-ide/src/app/plugins/desktop-client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,9 @@ export class DesktopClient extends ViewPlugin {

console.log('Sending result back to server', result)
this.ws.send(stringifyWithBigInt(result))

} catch (e) {

console.log('No provider...', parsed)
this.ws.send(stringifyWithBigInt({
jsonrpc: '2.0',
Expand Down
3 changes: 1 addition & 2 deletions apps/remix-ide/src/app/tabs/web3-provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,7 @@ export class Web3ProviderModule extends Plugin {
resolve(message)
}
try {
const t = await provider.sendAsync(payload)
resultFn(null, t)
resultFn(null, await provider.sendAsync(payload))
} catch (e) {
resultFn(e.error ? e.error : e)
}
Expand Down
17 changes: 5 additions & 12 deletions apps/remixdesktop/src/plugins/desktopHost.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,15 +147,13 @@ export class DesktopHostPluginClient extends ElectronBasePluginClient {
await new Promise(resolve => setTimeout(resolve, 1000))
}
console.log('CONNECTED TO REMOTE WEBSOCKET', this.webContentsId)
}
}



async sendAsync(data: RequestArguments, callback?: (error: string, result?: any) => void) {
async sendAsync(data: RequestArguments) {
if (!isConnected) {
console.log('NOT CONNECTED', this.webContentsId)
if (callback) {
callback('Not connected to the remote websocket', null)
return
}
return { error: 'Not connected to the remote websocket' }
}
console.log('SEND ASYNC', data, this.webContentsId, this.isInjected)
Expand All @@ -175,11 +173,6 @@ export class DesktopHostPluginClient extends ElectronBasePluginClient {

fs.appendFileSync(logFilePath, logEntry)
}

if (callback) {
callback(null, result)
return
}
return result
}
}
}