Skip to content

Commit 6010be3

Browse files
yann300Aniket-Engg
authored andcommitted
Revert "fix running script with browser extension (desktop)"
This reverts commit 4d575b3.
1 parent 9e13059 commit 6010be3

File tree

3 files changed

+7
-15
lines changed

3 files changed

+7
-15
lines changed

apps/remix-ide/src/app/plugins/desktop-client.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,9 @@ export class DesktopClient extends ViewPlugin {
244244

245245
console.log('Sending result back to server', result)
246246
this.ws.send(stringifyWithBigInt(result))
247+
247248
} catch (e) {
249+
248250
console.log('No provider...', parsed)
249251
this.ws.send(stringifyWithBigInt({
250252
jsonrpc: '2.0',

apps/remix-ide/src/app/tabs/web3-provider.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,7 @@ export class Web3ProviderModule extends Plugin {
8383
resolve(message)
8484
}
8585
try {
86-
const t = await provider.sendAsync(payload)
87-
console.log(t, payload)
88-
resultFn(null, t)
86+
resultFn(null, await provider.sendAsync(payload))
8987
} catch (e) {
9088
resultFn(e.error ? e.error : e)
9189
}

apps/remixdesktop/src/plugins/desktopHost.ts

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -147,15 +147,13 @@ export class DesktopHostPluginClient extends ElectronBasePluginClient {
147147
await new Promise(resolve => setTimeout(resolve, 1000))
148148
}
149149
console.log('CONNECTED TO REMOTE WEBSOCKET', this.webContentsId)
150-
}
150+
}
151+
151152

152-
async sendAsync(data: RequestArguments, callback?: (error: string, result?: any) => void) {
153+
154+
async sendAsync(data: RequestArguments) {
153155
if (!isConnected) {
154156
console.log('NOT CONNECTED', this.webContentsId)
155-
if (callback) {
156-
callback('Not connected to the remote websocket', null)
157-
return
158-
}
159157
return { error: 'Not connected to the remote websocket' }
160158
}
161159
console.log('SEND ASYNC', data, this.webContentsId, this.isInjected)
@@ -175,12 +173,6 @@ export class DesktopHostPluginClient extends ElectronBasePluginClient {
175173

176174
fs.appendFileSync(logFilePath, logEntry)
177175
}
178-
179-
if (callback) {
180-
console.log('SENDING BACK ASYNC', result, data, this.webContentsId, this.isInjected)
181-
callback(null, result)
182-
return
183-
}
184176
return result
185177
}
186178
}

0 commit comments

Comments
 (0)