@@ -38,6 +38,7 @@ import { useAsyncMemo } from "../../../../../hooks/useAsyncMemo";
38
38
import QuestionDialog from "../../../dialogs/QuestionDialog" ;
39
39
import { FilterVariation } from "../../devices/filter" ;
40
40
import { OtherSessionsSectionHeading } from "../../devices/OtherSessionsSectionHeading" ;
41
+ import { SettingsSection } from "../../shared/SettingsSection" ;
41
42
42
43
const confirmSignOut = async ( sessionsToSignOutCount : number ) : Promise < boolean > => {
43
44
const { finished } = Modal . createDialog ( QuestionDialog , {
@@ -225,62 +226,64 @@ const SessionManagerTab: React.FC = () => {
225
226
}
226
227
227
228
return (
228
- < SettingsTab heading = { _t ( "Sessions" ) } >
229
- < SecurityRecommendations
230
- devices = { devices }
231
- goToFilteredList = { onGoToFilteredList }
232
- currentDeviceId = { currentDeviceId }
233
- />
234
- < CurrentDeviceSection
235
- device = { currentDevice }
236
- localNotificationSettings = { localNotificationSettings . get ( currentDeviceId ) }
237
- setPushNotifications = { setPushNotifications }
238
- isSigningOut = { signingOutDeviceIds . includes ( currentDeviceId ) }
239
- isLoading = { isLoadingDeviceList }
240
- saveDeviceName = { ( deviceName ) => saveDeviceName ( currentDeviceId , deviceName ) }
241
- onVerifyCurrentDevice = { onVerifyCurrentDevice }
242
- onSignOutCurrentDevice = { onSignOutCurrentDevice }
243
- signOutAllOtherSessions = { signOutAllOtherSessions }
244
- otherSessionsCount = { otherSessionsCount }
245
- />
246
- { shouldShowOtherSessions && (
247
- < SettingsSubsection
248
- heading = {
249
- < OtherSessionsSectionHeading
250
- otherSessionsCount = { otherSessionsCount }
251
- signOutAllOtherSessions = { signOutAllOtherSessions ! }
252
- disabled = { ! ! signingOutDeviceIds . length }
253
- />
254
- }
255
- description = { _t (
256
- `For best security, verify your sessions and sign out ` +
257
- `from any session that you don't recognize or use anymore.` ,
258
- ) }
259
- data-testid = "other-sessions-section"
260
- >
261
- < FilteredDeviceList
262
- devices = { otherDevices }
263
- pushers = { pushers }
264
- localNotificationSettings = { localNotificationSettings }
265
- filter = { filter }
266
- expandedDeviceIds = { expandedDeviceIds }
267
- signingOutDeviceIds = { signingOutDeviceIds }
268
- selectedDeviceIds = { selectedDeviceIds }
269
- setSelectedDeviceIds = { setSelectedDeviceIds }
270
- onFilterChange = { setFilter }
271
- onDeviceExpandToggle = { onDeviceExpandToggle }
272
- onRequestDeviceVerification = {
273
- requestDeviceVerification ? onTriggerDeviceVerification : undefined
229
+ < SettingsTab >
230
+ < SettingsSection heading = { _t ( "Sessions" ) } >
231
+ < SecurityRecommendations
232
+ devices = { devices }
233
+ goToFilteredList = { onGoToFilteredList }
234
+ currentDeviceId = { currentDeviceId }
235
+ />
236
+ < CurrentDeviceSection
237
+ device = { currentDevice }
238
+ localNotificationSettings = { localNotificationSettings . get ( currentDeviceId ) }
239
+ setPushNotifications = { setPushNotifications }
240
+ isSigningOut = { signingOutDeviceIds . includes ( currentDeviceId ) }
241
+ isLoading = { isLoadingDeviceList }
242
+ saveDeviceName = { ( deviceName ) => saveDeviceName ( currentDeviceId , deviceName ) }
243
+ onVerifyCurrentDevice = { onVerifyCurrentDevice }
244
+ onSignOutCurrentDevice = { onSignOutCurrentDevice }
245
+ signOutAllOtherSessions = { signOutAllOtherSessions }
246
+ otherSessionsCount = { otherSessionsCount }
247
+ />
248
+ { shouldShowOtherSessions && (
249
+ < SettingsSubsection
250
+ heading = {
251
+ < OtherSessionsSectionHeading
252
+ otherSessionsCount = { otherSessionsCount }
253
+ signOutAllOtherSessions = { signOutAllOtherSessions ! }
254
+ disabled = { ! ! signingOutDeviceIds . length }
255
+ />
274
256
}
275
- onSignOutDevices = { onSignOutOtherDevices }
276
- saveDeviceName = { saveDeviceName }
277
- setPushNotifications = { setPushNotifications }
278
- ref = { filteredDeviceListRef }
279
- supportsMSC3881 = { supportsMSC3881 }
280
- />
281
- </ SettingsSubsection >
282
- ) }
283
- < LoginWithQRSection onShowQr = { onShowQrClicked } versions = { clientVersions } capabilities = { capabilities } />
257
+ description = { _t (
258
+ `For best security, verify your sessions and sign out ` +
259
+ `from any session that you don't recognize or use anymore.` ,
260
+ ) }
261
+ data-testid = "other-sessions-section"
262
+ >
263
+ < FilteredDeviceList
264
+ devices = { otherDevices }
265
+ pushers = { pushers }
266
+ localNotificationSettings = { localNotificationSettings }
267
+ filter = { filter }
268
+ expandedDeviceIds = { expandedDeviceIds }
269
+ signingOutDeviceIds = { signingOutDeviceIds }
270
+ selectedDeviceIds = { selectedDeviceIds }
271
+ setSelectedDeviceIds = { setSelectedDeviceIds }
272
+ onFilterChange = { setFilter }
273
+ onDeviceExpandToggle = { onDeviceExpandToggle }
274
+ onRequestDeviceVerification = {
275
+ requestDeviceVerification ? onTriggerDeviceVerification : undefined
276
+ }
277
+ onSignOutDevices = { onSignOutOtherDevices }
278
+ saveDeviceName = { saveDeviceName }
279
+ setPushNotifications = { setPushNotifications }
280
+ ref = { filteredDeviceListRef }
281
+ supportsMSC3881 = { supportsMSC3881 }
282
+ />
283
+ </ SettingsSubsection >
284
+ ) }
285
+ < LoginWithQRSection onShowQr = { onShowQrClicked } versions = { clientVersions } capabilities = { capabilities } />
286
+ </ SettingsSection >
284
287
</ SettingsTab >
285
288
) ;
286
289
} ;
0 commit comments