Skip to content

Commit dcd6dc2

Browse files
yann300Aniket-Engg
authored andcommitted
Update workspace.ts
1 parent f2a9e2c commit dcd6dc2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

libs/remix-ui/workspace/src/lib/actions/workspace.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,13 +272,15 @@ export const loadWorkspacePreset = async (template: WorkspaceTemplate = 'remixDe
272272
let content
273273

274274
if (params.code) {
275+
_paq.push(['trackEvent', 'workspace', 'template', 'code-template-code-param'])
275276
const hashed = bytesToHex(hash.keccakFromString(params.code))
276277

277278
path = 'contract-' + hashed.replace('0x', '').substring(0, 10) + (params.language && params.language.toLowerCase() === 'yul' ? '.yul' : '.sol')
278279
content = atob(decodeURIComponent(params.code))
279280
await workspaceProvider.set(path, content)
280281
}
281282
if (params.shareCode) {
283+
_paq.push(['trackEvent', 'workspace', 'template', 'code-template-shareCode-param'])
282284
const host = '127.0.0.1'
283285
const port = 5001
284286
const protocol = 'http'
@@ -303,6 +305,7 @@ export const loadWorkspacePreset = async (template: WorkspaceTemplate = 'remixDe
303305
await workspaceProvider.set(path, content)
304306
}
305307
if (params.url) {
308+
_paq.push(['trackEvent', 'workspace', 'template', 'code-template-url-param'])
306309
const data = await plugin.call('contentImport', 'resolve', params.url)
307310
path = data.cleanUrl
308311
content = data.content
@@ -326,6 +329,7 @@ export const loadWorkspacePreset = async (template: WorkspaceTemplate = 'remixDe
326329
}
327330
if (params.ghfolder) {
328331
try {
332+
_paq.push(['trackEvent', 'workspace', 'template', 'code-template-ghfolder-param'])
329333
const files = await plugin.call('contentImport', 'resolveGithubFolder', params.ghfolder)
330334
for (const [path, content] of Object.entries(files)) {
331335
await workspaceProvider.set(path, content)
@@ -344,6 +348,7 @@ export const loadWorkspacePreset = async (template: WorkspaceTemplate = 'remixDe
344348
case 'gist-template':
345349
// creates a new workspace gist-sample and get the file from gist
346350
try {
351+
_paq.push(['trackEvent', 'workspace', 'template', 'gist-template'])
347352
const gistId = params.gist
348353
const response: AxiosResponse = await axios.get(`https://api.github.com/gists/${gistId}`)
349354
const data = response.data as { files: any }

0 commit comments

Comments
 (0)