Skip to content

Commit d75a41f

Browse files
authored
runfix: Close right sidebar on title bar click (#13968)
1 parent 2c33201 commit d75a41f

File tree

2 files changed

+3
-31
lines changed

2 files changed

+3
-31
lines changed

src/script/components/UserDevices.tsx

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import React, {useEffect, useMemo, useState} from 'react';
2121

2222
import {ClientClassification} from '@wireapp/api-client/src/client/';
23-
import ko from 'knockout';
2423

2524
import {partition} from 'Util/ArrayUtil';
2625
import {t} from 'Util/LocalizerUtil';
@@ -166,25 +165,3 @@ const UserDevices: React.FC<UserDevicesProps> = ({
166165
};
167166

168167
export {UserDevices};
169-
170-
export const makeUserDevicesHistory = () => {
171-
const history = ko.observableArray<UserDevicesHistoryEntry>();
172-
const current = ko.pureComputed(() => history()[history().length - 1]);
173-
const reset = () => {
174-
history.removeAll();
175-
history.push({headline: '', state: UserDevicesState.DEVICE_LIST});
176-
};
177-
178-
reset();
179-
180-
return {
181-
current,
182-
goBack: () => {
183-
history.pop();
184-
},
185-
goTo: (state: UserDevicesState, headline: string) => {
186-
history.push({headline, state});
187-
},
188-
reset,
189-
};
190-
};

src/script/page/AppMain.tsx

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,16 @@ import {container} from 'tsyringe';
2525
import {CallingContainer} from 'Components/calling/CallingOverlayContainer';
2626
import {GroupCreationModal} from 'Components/Modals/GroupCreation/GroupCreationModal';
2727
import {LegalHoldModal} from 'Components/Modals/LegalHoldModal/LegalHoldModal';
28+
import {PrimaryModalComponent} from 'Components/Modals/PrimaryModal/PrimaryModal';
2829
import {registerReactComponent, useKoSubscribableChildren} from 'Util/ComponentUtil';
2930

3031
import {AppLock} from './AppLock';
3132
import {LeftSidebar} from './LeftSidebar';
3233
import {MainContent} from './MainContent';
33-
import {RightSidebar} from './RightSidebar';
34-
import {PanelEntity, PanelState} from './RightSidebar/RightSidebar';
34+
import {PanelEntity, PanelState, RightSidebar} from './RightSidebar';
3535
import {RootProvider} from './RootProvider';
3636
import {useAppMainState, ViewType} from './state';
3737

38-
import {PrimaryModalComponent} from '../components/Modals/PrimaryModal/PrimaryModal';
3938
import {User} from '../entity/User';
4039
import {TeamState} from '../team/TeamState';
4140
import {UserState} from '../user/UserState';
@@ -63,13 +62,9 @@ const AppContainer: FC<AppContainerProps> = ({root}) => {
6362
const currentState = history.at(-1);
6463

6564
const toggleRightSidebar = (panelState: PanelState, params: RightSidebarParams) => {
66-
const newParamId = params.entity?.id;
67-
const currentParamId = currentEntity?.id;
68-
6965
const isDifferentState = currentState !== panelState;
70-
const isDifferentParams = newParamId !== currentParamId;
7166

72-
if (isDifferentState || isDifferentParams) {
67+
if (isDifferentState) {
7368
goTo(panelState, params);
7469

7570
return;

0 commit comments

Comments
 (0)