Skip to content

Commit

Permalink
handling empty apps without analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdugne committed May 30, 2020
1 parent abe6853 commit 3ae08ae
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions cherry/libs/analytics.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
--------------------------------------------------------------------------------

local http = _G.http or require 'cherry.libs.http'

local ANALYTICS_URL = 'http://www.google-analytics.com/collect'
local params
local params = nil

--------------------------------------------------------------------------------

Expand All @@ -21,7 +20,7 @@ end
--------------------------------------------------------------------------------

local function screenview(page)
if (_G.SIMULATOR or App.ENV == 'development') then
if (_G.SIMULATOR or App.ENV == 'development' or params == nil) then
return
end

Expand All @@ -39,7 +38,7 @@ end
--------------------------------------------------------------------------------

local function event(category, action, label)
if (_G.SIMULATOR or App.ENV == 'development') then
if (_G.SIMULATOR or App.ENV == 'development' or params == nil) then
return
end

Expand Down

0 comments on commit 3ae08ae

Please sign in to comment.