Skip to content

Commit

Permalink
analytics bug fixed + removed extension forced update
Browse files Browse the repository at this point in the history
  • Loading branch information
arjunpat committed Jan 2, 2019
1 parent b843d5f commit 463fd3d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions extensions/chrome/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,10 @@ window.onbeforeunload = () => {
}


RequestManager.getLatestVersion().then(version => {
/*RequestManager.getLatestVersion().then(version => {
if (version !== VERSION) {
view.hidePreloader();
view.switchTo('update-extn');
document.querySelector('a[href="chrome://extensions"]').onclick = () => chrome.tabs.create({url: 'chrome://extensions'});
}
});
});*/
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "period-countdown",
"version": "3.0.1",
"version": "3.0.3",
"description": "A simple way to keep track of the remaining time in class",
"main": "server.js",
"scripts": {
Expand Down
5 changes: 4 additions & 1 deletion public/js/Analytics.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,15 @@ export default class Analytics {
if (!this.pathname || !this.deviceId || typeof this.theme !== 'number' || !this.version || !this.school)
return;

if ((this.pathname === '/' || this.pathname === 'extn') && typeof this.period !== 'number')
return;

this.sent = true;
while (window.performance.timing.loadEventEnd - window.performance.timing.navigationStart < 0)
await this.sleep(1);

let data = {};
if ((this.pathname === '/' || this.pathname === 'extn') && typeof this.period === 'number') { // index page or extn
if (this.pathname === '/' || this.pathname === 'extn') { // index page or extn

data.prefs = {
theme: this.theme,
Expand Down

0 comments on commit 463fd3d

Please sign in to comment.