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

View File

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