Fix accounts.json update with missing enabled key

This commit is contained in:
miruka 2020-07-11 14:36:30 -04:00
parent 3c620f6fd1
commit f05f2357c7
2 changed files with 9 additions and 4 deletions

View File

@ -1,11 +1,11 @@
# TODO # TODO
- save and restore status in accounts.json
- mark accounts as offline when closing mirage - mark accounts as offline when closing mirage
- document new x11 dependnecy (auto-idle) - document new x11 dependnecy (auto-idle)
- auto-idle for Windows and OSX - auto-idle for Windows and OSX
- open context menus centered on touch screens - open context menus centered on touch screens
- retrieve last seen time for offline members on hover/in profile - retrieve last seen time for offline members on hover/in profile
- auto-away after a configurable idle time
- status based on process detection - status based on process detection
- retry if media not found - retry if media not found
- fix members not synced bug - fix members not synced bug

View File

@ -210,9 +210,14 @@ class Accounts(JSONDataFile):
saved = await self.read() saved = await self.read()
saved[user_id]["enabled"] = enabled or saved[user_id]["enabled"] if enabled is not None:
saved[user_id]["presence"] = presence or saved[user_id]["presence"] saved[user_id]["enabled"] = enabled
saved[user_id]["order"] = order or saved[user_id]["order"]
if presence is not None:
saved[user_id]["presence"] = presence
if order is not None:
saved[user_id]["order"] = order
await self.write({**saved}) await self.write({**saved})