Skip to content

Commit dcbbacc

Browse files
committed
notifs: Add session.registerPushTokenRequestsInProgress to report
1 parent 5a569b9 commit dcbbacc

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/settings/NotifTroubleshootingScreen.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import {
2020
getGlobalSession,
2121
getGlobalSettings,
2222
getRealm,
23+
getSession,
2324
getSettings,
2425
} from '../directSelectors';
2526
import {
@@ -149,6 +150,14 @@ export type NotificationReport = {|
149150
+devicePushToken: string | null,
150151
+ackedPushToken: string | null,
151152

153+
/**
154+
* See PerAccountSessionState.registerPushTokenRequestsInProgress.
155+
*
156+
* Pre-#5006, this will be undefined except for the active account if any.
157+
*/
158+
// TODO(#5006): When we maintain this for all accounts, include it for all.
159+
+registerPushTokenRequestsInProgress: number | void,
160+
152161
/**
153162
* Server data from an event queue, if any.
154163
*
@@ -200,12 +209,15 @@ export function useNotificationReportsByIdentityKey(): Map<string, NotificationR
200209
const identity = identityOfAccount(account);
201210
const isLoggedIn = apiKey !== '';
202211

212+
let registerPushTokenRequestsInProgress = undefined;
203213
let serverData = undefined;
204214
if (
205215
activeAccountState
206216
&& keyOfIdentity(identityOfAccount(getAccount(activeAccountState)))
207217
=== keyOfIdentity(identityOfAccount(account))
208218
) {
219+
registerPushTokenRequestsInProgress =
220+
getSession(activeAccountState).registerPushTokenRequestsInProgress;
209221
serverData = getHaveServerData(activeAccountState)
210222
? {
211223
zulipVersion: getServerVersion(activeAccountState),
@@ -249,6 +261,7 @@ export function useNotificationReportsByIdentityKey(): Map<string, NotificationR
249261
isLoggedIn,
250262
devicePushToken: pushToken,
251263
ackedPushToken,
264+
registerPushTokenRequestsInProgress,
252265
serverData,
253266
},
254267
];

0 commit comments

Comments
 (0)