diff --git a/src/backend/user_files.py b/src/backend/user_files.py index 40fe18d7..81954aa3 100644 --- a/src/backend/user_files.py +++ b/src/backend/user_files.py @@ -192,10 +192,10 @@ class Accounts(JSONDataFile): "token": client.access_token, "device_id": client.device_id, "enabled": True, - "order": max( + "order": max([ account.get("order", i) for i, account in enumerate(saved.values()) - ) + 1, + ] or [-1]) + 1, }, })