Skip to content

Commit ee8e48f

Browse files
committed
update fix as per review comments
1 parent d112b00 commit ee8e48f

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

apps/remix-ide/src/app/plugins/templates-selection/templates.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ export const templates = (intl: any, plugin: any): TemplateGroup[] => {
268268
tooltip: "Cookbook is a Smart Contract Search Tool. Click here to open Cookbook and browse Contracts.",
269269
onClick: async () => {
270270
await plugin.call('manager', 'activatePlugin', 'cookbookdev')
271-
plugin.call('menuicons', 'showContent', 'cookbookdev')
271+
await plugin.call('menuicons', 'showContent', 'cookbookdev')
272272
},
273273
onClickLabel: 'Open Cookbook Plugin',
274274
description: 'Discover more templates!',

apps/vyper/src/app/utils/compiler.tsx

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,8 @@ export async function compile(url: string, contract: Contract): Promise<VyperCom
8282
[contractName] : { content : contract.content }
8383
}
8484
}
85-
let response
86-
if (url.endsWith('/')) {
87-
response = await axios.post(`${url}compile`, compilePackage )
88-
} else {
89-
response = await axios.post(`${url}/compile`, compilePackage )
90-
}
9185

86+
let response = await axios.post(`${url.endsWith('/') ? url + 'compile' : url + '/compile'}`, compilePackage )
9287
if (response.status === 404) {
9388
throw new Error(`Vyper compiler not found at "${url}".`)
9489
}
@@ -101,17 +96,17 @@ export async function compile(url: string, contract: Contract): Promise<VyperCom
10196
response = null
10297
let result: any
10398

104-
const status = await (await axios.get(url + '/status/' + compileCode , {
99+
const status = await (await axios.get(`${url.endsWith('/') ? url + 'status/' : url + '/status/'}`+ compileCode , {
105100
method: 'Get'
106101
})).data
107102
if (status === 'SUCCESS') {
108-
result = await(await axios.get(url + '/artifacts/' + compileCode , {
103+
result = await(await axios.get(`${url.endsWith('/') ? url + 'artifacts/' : url + '/artifacts/'}` + compileCode , {
109104
method: 'Get'
110105
})).data
111106

112107
return result
113108
} else if (status === 'FAILED') {
114-
const intermediate = await(await axios.get(url + '/exceptions/' + compileCode , {
109+
const intermediate = await(await axios.get(`${url.endsWith('/') ? url + 'exceptions/' : url + '/exceptions/'}` + compileCode , {
115110
method: 'Get'
116111
})).data
117112
return intermediate

0 commit comments

Comments
 (0)