From 0b2383ab56ea1714833ebbc3ffa0e65eeb5cd0ba Mon Sep 17 00:00:00 2001
From: Stefan Melmuk <509385+stefan0xC@users.noreply.github.com>
Date: Wed, 31 Jan 2024 22:31:22 +0100
Subject: [PATCH] fix push device registration (#4297)

don't try to register a push device when the device is new
it will be registered when the push token is saved

fixes #4296
---
 src/api/identity.rs | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/api/identity.rs b/src/api/identity.rs
index 6f1155bb..9f3cd1bf 100644
--- a/src/api/identity.rs
+++ b/src/api/identity.rs
@@ -268,7 +268,9 @@ async fn _password_login(
     }
 
     // register push device
-    register_push_device(&mut device, conn).await?;
+    if !new_device {
+        register_push_device(&mut device, conn).await?;
+    }
 
     // Common
     // ---
-- 
GitLab