Assume all accounts have primary devices

This commit is contained in:
Jon Chambers
2023-12-05 17:32:49 -05:00
committed by Jon Chambers
parent 69990c23a5
commit 00e72a30c9
11 changed files with 47 additions and 44 deletions

View File

@@ -62,7 +62,7 @@ public class PushNotificationManager {
public void sendRateLimitChallengeNotification(final Account destination, final String challengeToken)
throws NotPushRegisteredException {
final Device device = destination.getDevice(Device.PRIMARY_ID).orElseThrow(NotPushRegisteredException::new);
final Device device = destination.getPrimaryDevice();
final Pair<String, PushNotification.TokenType> tokenAndType = getToken(device);
sendNotification(new PushNotification(tokenAndType.first(), tokenAndType.second(),