Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
13f961da
Unverified
Commit
13f961da
authored
Oct 17, 2021
by
Rob
Committed by
GitHub
Oct 17, 2021
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1635 from ethereum/m10
track compile event only once per autocompile session
parents
21fe63a7
23f9bb57
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
9 deletions
+16
-9
compiler-container.tsx
...remix-ui/solidity-compiler/src/lib/compiler-container.tsx
+16
-9
No files found.
libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx
View file @
13f961da
...
@@ -23,6 +23,7 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
...
@@ -23,6 +23,7 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
const
[
state
,
setState
]
=
useState
({
const
[
state
,
setState
]
=
useState
({
hideWarnings
:
false
,
hideWarnings
:
false
,
autoCompile
:
false
,
autoCompile
:
false
,
matomoAutocompileOnce
:
true
,
optimize
:
false
,
optimize
:
false
,
compileTimeout
:
null
,
compileTimeout
:
null
,
timeout
:
300
,
timeout
:
300
,
...
@@ -69,7 +70,6 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
...
@@ -69,7 +70,6 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
const
optimize
=
params
.
optimize
const
optimize
=
params
.
optimize
const
runs
=
params
.
runs
as
string
const
runs
=
params
.
runs
as
string
const
evmVersion
=
params
.
evmVersion
const
evmVersion
=
params
.
evmVersion
return
{
return
{
...
prevState
,
...
prevState
,
hideWarnings
:
api
.
getAppParameter
(
'hideWarnings'
)
as
boolean
||
false
,
hideWarnings
:
api
.
getAppParameter
(
'hideWarnings'
)
as
boolean
||
false
,
...
@@ -135,6 +135,12 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
...
@@ -135,6 +135,12 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
}
}
},
[
configurationSettings
])
},
[
configurationSettings
])
const
_retrieveVersion
=
(
version
?)
=>
{
if
(
!
version
)
version
=
state
.
selectedVersion
if
(
version
===
'builtin'
)
version
=
state
.
defaultVersion
return
semver
.
coerce
(
version
)
?
semver
.
coerce
(
version
).
version
:
''
}
// fetching both normal and wasm builds and creating a [version, baseUrl] map
// fetching both normal and wasm builds and creating a [version, baseUrl] map
const
fetchAllVersion
=
async
(
callback
)
=>
{
const
fetchAllVersion
=
async
(
callback
)
=>
{
let
selectedVersion
,
allVersionsWasm
,
isURL
let
selectedVersion
,
allVersionsWasm
,
isURL
...
@@ -281,7 +287,14 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
...
@@ -281,7 +287,14 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
compileIcon
.
current
.
setAttribute
(
'title'
,
'idle'
)
compileIcon
.
current
.
setAttribute
(
'title'
,
'idle'
)
compileIcon
.
current
.
classList
.
remove
(
'remixui_spinningIcon'
)
compileIcon
.
current
.
classList
.
remove
(
'remixui_spinningIcon'
)
compileIcon
.
current
.
classList
.
remove
(
'remixui_bouncingIcon'
)
compileIcon
.
current
.
classList
.
remove
(
'remixui_bouncingIcon'
)
if
(
!
state
.
autoCompile
||
(
state
.
autoCompile
&&
state
.
matomoAutocompileOnce
))
{
_paq
.
push
([
'trackEvent'
,
'compiler'
,
'compiled_with_version'
,
_retrieveVersion
()])
_paq
.
push
([
'trackEvent'
,
'compiler'
,
'compiled_with_version'
,
_retrieveVersion
()])
if
(
state
.
autoCompile
&&
state
.
matomoAutocompileOnce
)
{
setState
(
prevState
=>
{
return
{
...
prevState
,
matomoAutocompileOnce
:
false
}
})
}
}
}
}
const
scheduleCompilation
=
()
=>
{
const
scheduleCompilation
=
()
=>
{
...
@@ -305,12 +318,6 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
...
@@ -305,12 +318,6 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
compileTabLogic
.
runCompiler
(
hhCompilation
)
compileTabLogic
.
runCompiler
(
hhCompilation
)
}
}
const
_retrieveVersion
=
(
version
?)
=>
{
if
(
!
version
)
version
=
state
.
selectedVersion
if
(
version
===
'builtin'
)
version
=
state
.
defaultVersion
return
semver
.
coerce
(
version
)
?
semver
.
coerce
(
version
).
version
:
''
}
const
_updateVersionSelector
=
(
version
,
customUrl
=
''
)
=>
{
const
_updateVersionSelector
=
(
version
,
customUrl
=
''
)
=>
{
// update selectedversion of previous one got filtered out
// update selectedversion of previous one got filtered out
let
selectedVersion
=
version
let
selectedVersion
=
version
...
@@ -384,7 +391,7 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
...
@@ -384,7 +391,7 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
const
handleLoadVersion
=
(
value
)
=>
{
const
handleLoadVersion
=
(
value
)
=>
{
setState
(
prevState
=>
{
setState
(
prevState
=>
{
return
{
...
prevState
,
selectedVersion
:
value
}
return
{
...
prevState
,
selectedVersion
:
value
,
matomoAutocompileOnce
:
true
}
})
})
updateCurrentVersion
(
value
)
updateCurrentVersion
(
value
)
_updateVersionSelector
(
value
)
_updateVersionSelector
(
value
)
...
@@ -405,7 +412,7 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
...
@@ -405,7 +412,7 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
api
.
setAppParameter
(
'autoCompile'
,
checked
)
api
.
setAppParameter
(
'autoCompile'
,
checked
)
checked
&&
compile
()
checked
&&
compile
()
setState
(
prevState
=>
{
setState
(
prevState
=>
{
return
{
...
prevState
,
autoCompile
:
checked
}
return
{
...
prevState
,
autoCompile
:
checked
,
matomoAutocompileOnce
:
state
.
matomoAutocompileOnce
||
checked
}
})
})
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment