File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
src/components/structures Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -190,11 +190,18 @@ export default class UserMenu extends React.Component<IProps, IState> {
190190 this . setState ( { contextMenuPosition : null } ) ; // also close the menu
191191 } ;
192192
193- private onSignOutClick = ( ev : ButtonEvent ) => {
193+ private onSignOutClick = async ( ev : ButtonEvent ) => {
194194 ev . preventDefault ( ) ;
195195 ev . stopPropagation ( ) ;
196196
197- Modal . createTrackedDialog ( 'Logout from LeftPanel' , '' , LogoutDialog ) ;
197+ const cli = MatrixClientPeg . get ( ) ;
198+ if ( ! cli || ! cli . isCryptoEnabled ( ) || ! ( await cli . exportRoomKeys ( ) ) ?. length ) {
199+ // log out without user prompt if they have no local megolm sessions
200+ dis . dispatch ( { action : 'logout' } ) ;
201+ } else {
202+ Modal . createTrackedDialog ( 'Logout from LeftPanel' , '' , LogoutDialog ) ;
203+ }
204+
198205 this . setState ( { contextMenuPosition : null } ) ; // also close the menu
199206 } ;
200207
You can’t perform that action at this time.
0 commit comments