Merge pull request #3495 from overleaf/ae-prettier-2

Upgrade Prettier to v2

GitOrigin-RevId: 85aa3fa1acb6332c4f58c46165a43d1a51471f33
This commit is contained in:
Alf Eaton
2021-04-15 02:05:22 +00:00
committed by Copybot
parent 930d7ba028
commit 1ebc8a79cb
582 changed files with 20382 additions and 20374 deletions
+6 -8
View File
@@ -22,8 +22,8 @@ const CACHE_KEY = 'mbEvents'
let heartbeatsSent = 0
let nextHeartbeat = new Date()
App.factory('eventTracking', function($http, localStorage) {
const _getEventCache = function() {
App.factory('eventTracking', function ($http, localStorage) {
const _getEventCache = function () {
let eventCache = localStorage(CACHE_KEY)
// Initialize as an empy object if the event cache is still empty.
@@ -35,12 +35,12 @@ App.factory('eventTracking', function($http, localStorage) {
return eventCache
}
const _eventInCache = function(key) {
const _eventInCache = function (key) {
const curCache = _getEventCache()
return curCache[key] || false
}
const _addEventToCache = function(key) {
const _addEventToCache = function (key) {
const curCache = _getEventCache()
curCache[key] = true
@@ -86,9 +86,7 @@ App.factory('eventTracking', function($http, localStorage) {
? (heartbeatsSent - 2) * 60
: 300
return (nextHeartbeat = moment()
.add(backoffSecs, 'seconds')
.toDate())
return (nextHeartbeat = moment().add(backoffSecs, 'seconds').toDate())
},
sendMB(key, segmentation) {
@@ -124,7 +122,7 @@ App.factory('eventTracking', function($http, localStorage) {
}
})
export default $('.navbar a').on('click', function(e) {
export default $('.navbar a').on('click', function (e) {
const href = $(e.target).attr('href')
if (href != null) {
return ga('send', 'event', 'navigation', 'top menu bar', href)