Skip to content

Commit

Permalink
app
Browse files Browse the repository at this point in the history
  • Loading branch information
bunsenstraat committed Oct 4, 2024
1 parent a387ebc commit ce5424e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
15 changes: 2 additions & 13 deletions apps/remix-ide-e2e/src/tests/matomo.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,12 @@ module.exports = {
init(browser, done, 'http://127.0.0.1:8080', false)
},
'confirm Matomo #group1 #flaky': function (browser: NightwatchBrowser) {
browser.pause(1000).perform((done) => {
browser.perform((done) => {
browser
.execute(function () {
localStorage.removeItem('config-v0.8:.remix.config')
localStorage.setItem('showMatomo', 'true')
}, [])
.pause(2000)
.refreshPage()
.perform(done())
})
Expand Down Expand Up @@ -68,13 +67,12 @@ module.exports = {
})
},
'decline Matomo #group1': function (browser: NightwatchBrowser) {
browser.pause(2000).perform((done) => {
browser.perform((done) => {
browser.execute(function () {
localStorage.removeItem('config-v0.8:.remix.config')
localStorage.setItem('showMatomo', 'true')
localStorage.removeItem('matomo-analytics-consent')
}, [])
.pause(1000)
.refreshPage()
.perform(done())
})
Expand Down Expand Up @@ -114,7 +112,6 @@ module.exports = {
localStorage.setItem('showMatomo', 'true')
localStorage.removeItem('matomo-analytics-consent')
}, [])
.pause(1000)
.refreshPage()
.perform(done())
})
Expand Down Expand Up @@ -199,7 +196,6 @@ module.exports = {
localStorage.setItem('showMatomo', 'true')
localStorage.removeItem('matomo-analytics-consent')
}, [])
.pause(10000)
.refreshPage()
.perform(done())
})
Expand Down Expand Up @@ -252,7 +248,6 @@ module.exports = {
oldTimestamp.setMonth(oldTimestamp.getMonth() - 7)
localStorage.setItem('matomo-analytics-consent', oldTimestamp.getTime().toString())
}, [])
.pause(1000)
.refreshPage()
.perform(done())
})
Expand Down Expand Up @@ -295,7 +290,6 @@ module.exports = {
recentTimestamp.setMonth(recentTimestamp.getMonth() - 1)
localStorage.setItem('matomo-analytics-consent', recentTimestamp.getTime().toString())
}, [])
.pause(1000)
.refreshPage()
.perform(done())
})
Expand Down Expand Up @@ -338,7 +332,6 @@ module.exports = {
localStorage.setItem('showMatomo', 'true')
localStorage.removeItem('matomo-analytics-consent')
}, [])
.pause(1000)
.refreshPage()
.perform(done())
})
Expand Down Expand Up @@ -381,7 +374,6 @@ module.exports = {
oldTimestamp.setMonth(oldTimestamp.getMonth() - 7)
localStorage.setItem('matomo-analytics-consent', oldTimestamp.getTime().toString())
}, [])
.pause(1000)
.refreshPage()
.perform(done())
})
Expand All @@ -400,7 +392,6 @@ module.exports = {
recentTimestamp.setMonth(recentTimestamp.getMonth() - 1)
localStorage.setItem('matomo-analytics-consent', recentTimestamp.getTime().toString())
}, [])
.pause(1000)
.refreshPage()
.perform(done())
})
Expand All @@ -420,7 +411,6 @@ module.exports = {
recentTimestamp.setMonth(recentTimestamp.getMonth() - 1)
localStorage.setItem('matomo-analytics-consent', recentTimestamp.getTime().toString())
}, [])
.pause(1000)
.refreshPage()
.perform(done())
})
Expand All @@ -436,7 +426,6 @@ module.exports = {
oldTimestamp.setMonth(oldTimestamp.getMonth() - 7)
localStorage.setItem('matomo-analytics-consent', oldTimestamp.getTime().toString())
}, [])
.pause(1000)
.refreshPage()
.perform(done())
})
Expand Down
7 changes: 6 additions & 1 deletion apps/remix-ide/src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,12 @@ class AppComponent {
|| (this.matomoCurrentSetting === false
&& (!lastMatomoCheck || new Date(Number(lastMatomoCheck)) < sixMonthsAgo)
));
_paq.push(['trackEvent', 'App', 'showMatomo', this.showMatomo]);

if(this.matomoCurrentSetting === false
&& (!lastMatomoCheck || new Date(Number(lastMatomoCheck)) < sixMonthsAgo)) {
_paq.push(['trackEvent', 'Matomo', 'refreshMatomoPermissions']);
}


this.walkthroughService = new WalkthroughService(appManager)

Expand Down

0 comments on commit ce5424e

Please sign in to comment.