Browse Source

Fix posthog (#1992)

Nikhil Rao 1 year ago
parent
commit
b4bb849388
2 changed files with 3 additions and 1 deletions
  1. 2 0
      reflex/constants/base.py
  2. 1 1
      reflex/utils/telemetry.py

+ 2 - 0
reflex/constants/base.py

@@ -45,6 +45,8 @@ class Dirs(SimpleNamespace):
     WEB_ASSETS = os.path.join(WEB, "public")
     WEB_ASSETS = os.path.join(WEB, "public")
     # The env json file.
     # The env json file.
     ENV_JSON = os.path.join(WEB, "env.json")
     ENV_JSON = os.path.join(WEB, "env.json")
+    # The reflex json file.
+    REFLEX_JSON = os.path.join(WEB, "reflex.json")
 
 
 
 
 class Reflex(SimpleNamespace):
 class Reflex(SimpleNamespace):

+ 1 - 1
reflex/utils/telemetry.py

@@ -90,7 +90,7 @@ def send(event: str, telemetry_enabled: bool | None = None) -> bool:
 
 
     try:
     try:
         telemetry = Telemetry()
         telemetry = Telemetry()
-        with open(constants.REFLEX_JSON) as f:  # type: ignore
+        with open(constants.Dirs.REFLEX_JSON) as f:
             reflex_json = json.load(f)
             reflex_json = json.load(f)
             distinct_id = reflex_json["project_hash"]
             distinct_id = reflex_json["project_hash"]
         post_hog = {
         post_hog = {