@@ -272,13 +272,15 @@ export const loadWorkspacePreset = async (template: WorkspaceTemplate = 'remixDe
272
272
let content
273
273
274
274
if ( params . code ) {
275
+ _paq . push ( [ 'trackEvent' , 'workspace' , 'template' , 'code-template-code-param' ] )
275
276
const hashed = bytesToHex ( hash . keccakFromString ( params . code ) )
276
277
277
278
path = 'contract-' + hashed . replace ( '0x' , '' ) . substring ( 0 , 10 ) + ( params . language && params . language . toLowerCase ( ) === 'yul' ? '.yul' : '.sol' )
278
279
content = atob ( decodeURIComponent ( params . code ) )
279
280
await workspaceProvider . set ( path , content )
280
281
}
281
282
if ( params . shareCode ) {
283
+ _paq . push ( [ 'trackEvent' , 'workspace' , 'template' , 'code-template-shareCode-param' ] )
282
284
const host = '127.0.0.1'
283
285
const port = 5001
284
286
const protocol = 'http'
@@ -303,6 +305,7 @@ export const loadWorkspacePreset = async (template: WorkspaceTemplate = 'remixDe
303
305
await workspaceProvider . set ( path , content )
304
306
}
305
307
if ( params . url ) {
308
+ _paq . push ( [ 'trackEvent' , 'workspace' , 'template' , 'code-template-url-param' ] )
306
309
const data = await plugin . call ( 'contentImport' , 'resolve' , params . url )
307
310
path = data . cleanUrl
308
311
content = data . content
@@ -326,6 +329,7 @@ export const loadWorkspacePreset = async (template: WorkspaceTemplate = 'remixDe
326
329
}
327
330
if ( params . ghfolder ) {
328
331
try {
332
+ _paq . push ( [ 'trackEvent' , 'workspace' , 'template' , 'code-template-ghfolder-param' ] )
329
333
const files = await plugin . call ( 'contentImport' , 'resolveGithubFolder' , params . ghfolder )
330
334
for ( const [ path , content ] of Object . entries ( files ) ) {
331
335
await workspaceProvider . set ( path , content )
@@ -344,6 +348,7 @@ export const loadWorkspacePreset = async (template: WorkspaceTemplate = 'remixDe
344
348
case 'gist-template' :
345
349
// creates a new workspace gist-sample and get the file from gist
346
350
try {
351
+ _paq . push ( [ 'trackEvent' , 'workspace' , 'template' , 'gist-template' ] )
347
352
const gistId = params . gist
348
353
const response : AxiosResponse = await axios . get ( `https://api.github.com/gists/${ gistId } ` )
349
354
const data = response . data as { files : any }
0 commit comments