mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-01 02:05:00 +00:00
fix: Preserve existing UUID when marking analytics as disabled
This commit is contained in:
parent
b722572a28
commit
7b6ad16fdb
1 changed files with 6 additions and 1 deletions
|
@ -46,7 +46,12 @@ class Analytics:
|
||||||
|
|
||||||
def mark_as_disabled(self):
|
def mark_as_disabled(self):
|
||||||
data_file = self.get_data_file_path()
|
data_file = self.get_data_file_path()
|
||||||
data = {"uuid": str(uuid.uuid4()), "disabled": True}
|
if data_file.exists():
|
||||||
|
with open(data_file, "r") as f:
|
||||||
|
data = json.load(f)
|
||||||
|
else:
|
||||||
|
data = {"uuid": str(uuid.uuid4())}
|
||||||
|
data["disabled"] = True
|
||||||
with open(data_file, "w") as f:
|
with open(data_file, "w") as f:
|
||||||
json.dump(data, f)
|
json.dump(data, f)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue