Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Commit

Permalink
Move start time for error timer into startBackground. (#3707)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenba committed Nov 9, 2017
1 parent 9a5a622 commit 5a3e01c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
6 changes: 2 additions & 4 deletions addon/webextension/background/senderror.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
/* globals analytics, communication, makeUuid, Raven, catcher, auth, log */
/* globals startBackground, analytics, communication, makeUuid, Raven, catcher, auth, log */

"use strict";

const startTime = Date.now();

this.senderror = (function() {
let exports = {};

Expand Down Expand Up @@ -79,7 +77,7 @@ this.senderror = (function() {
message = error.message;
}
}
if (Date.now() - startTime > 5 * 1000) {
if (Date.now() - startBackground.startTime > 5 * 1000) {
browser.notifications.create(id, {
type: "basic",
// FIXME: need iconUrl for an image, see #2239
Expand Down
3 changes: 2 additions & 1 deletion addon/webextension/background/startBackground.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
and loads the rest of the background page in response to those events, forwarding
the events to main.onClicked, main.onClickedContextMenu, or communication.onMessage
*/
const startTime = Date.now();

this.startBackground = (function() {
let exports = {};
let exports = {startTime};

const backgroundScripts = [
"log.js",
Expand Down

0 comments on commit 5a3e01c

Please sign in to comment.