This commit is contained in:
Hugh Nimmo-Smith 2026-01-12 12:51:27 +00:00
parent c4e7cbe285
commit 1655bea6f0

View File

@ -152,16 +152,11 @@ const SessionManagerTab: React.FC<{
* delegated auth provider.
* See https://github.com/matrix-org/matrix-spec-proposals/pull/3824
*/
const accountManagementEndpoint = useAsyncMemo(async () => {
const accountManagement = useAsyncMemo(async () => {
await sdkContext.oidcClientStore.readyPromise; // wait for the store to be ready
return sdkContext.oidcClientStore.accountManagementEndpoint;
return { endpoint:sdkContext.oidcClientStore.accountManagementEndpoint, actionsSupported: sdkContext.oidcClientStore.accountManagementActionsSupported };
}, [sdkContext.oidcClientStore]);
const accountManagementActionsSupported = useAsyncMemo(async () => {
await sdkContext.oidcClientStore.readyPromise; // wait for the store to be ready
return sdkContext.oidcClientStore.accountManagementActionsSupported;
}, [sdkContext.oidcClientStore]);
const disableMultipleSignout = !!accountManagementEndpoint;
const disableMultipleSignout = !!accountManagement?.endpoint;
const userId = matrixClient?.getUserId();
const currentUserMember = (userId && matrixClient?.getUser(userId)) || undefined;
const clientVersions = useAsyncMemo(() => matrixClient.getVersions(), [matrixClient]);
@ -237,8 +232,8 @@ const SessionManagerTab: React.FC<{
const { onSignOutCurrentDevice, onSignOutOtherDevices, signingOutDeviceIds } = useSignOut(
matrixClient,
onSignoutResolvedCallback,
accountManagementEndpoint,
accountManagementActionsSupported,
accountManagement?.endpoint,
accountManagement?.actionsSupported,
);
useEffect(
@ -303,8 +298,8 @@ const SessionManagerTab: React.FC<{
onSignOutCurrentDevice={onSignOutCurrentDevice}
signOutAllOtherSessions={signOutAllOtherSessions}
otherSessionsCount={otherSessionsCount}
accountManagementEndpoint={accountManagementEndpoint}
accountManagementActionsSupported={accountManagementActionsSupported}
accountManagementEndpoint={accountManagement?.endpoint}
accountManagementActionsSupported={accountManagement?.actionsSupported}
/>
{shouldShowOtherSessions && (
<SettingsSubsection
@ -338,7 +333,8 @@ const SessionManagerTab: React.FC<{
setPushNotifications={setPushNotifications}
ref={filteredDeviceListRef}
supportsMSC3881={supportsMSC3881}
accountManagementEndpoint={accountManagementEndpoint}
accountManagementEndpoint={accountManagement?.endpoint}
accountManagementActionsSupported={accountManagement?.actionsSupported}
/>
</SettingsSubsection>
)}