fix bug when restoring using existing push token

This commit is contained in:
JJTech0130 2023-05-02 13:37:32 -04:00
parent d66e3e0adf
commit 1bd21cbbb7
No known key found for this signature in database
GPG key ID: 23C92EBCCF8F93D6

View file

@ -101,7 +101,13 @@ class APNSConnection:
): ):
raise Exception("Failed to connect") raise Exception("Failed to connect")
self.token = _get_field(payload[1], 3) new_token = _get_field(payload[1], 3)
if new_token is not None:
self.token = new_token
elif token is not None:
self.token = token
else:
raise Exception("No token")
return self.token return self.token