Excluding follow button in the header from being added to the stack (#5723)
This commit is contained in:
parent
f1c3538283
commit
1a35250811
3 changed files with 11 additions and 2 deletions
|
|
@ -105,7 +105,9 @@ Navigation.events().registerAppLaunchedListener(() => {
|
|||
});
|
||||
|
||||
export function componentDidAppearListener({componentId}) {
|
||||
EphemeralStore.addNavigationComponentId(componentId);
|
||||
if (componentId.indexOf('!screen') !== 0) {
|
||||
EphemeralStore.addNavigationComponentId(componentId);
|
||||
}
|
||||
|
||||
switch (componentId) {
|
||||
case 'MainSidebar':
|
||||
|
|
|
|||
|
|
@ -52,6 +52,12 @@ describe('componentDidAppearListener', () => {
|
|||
expect(EventEmitter.emit).toHaveBeenCalledTimes(1);
|
||||
expect(EventEmitter.emit).toHaveBeenCalledWith(NavigationTypes.BLUR_POST_DRAFT);
|
||||
});
|
||||
|
||||
it('should not add componentIds starting with "!screen" to the store as they are not screens', () => {
|
||||
const componentId = '!screen';
|
||||
componentDidAppearListener({componentId});
|
||||
expect(EphemeralStore.addNavigationComponentId).not.toHaveBeenCalledWith(componentId);
|
||||
});
|
||||
});
|
||||
|
||||
describe('componentDidDisappearListener', () => {
|
||||
|
|
|
|||
|
|
@ -57,7 +57,8 @@ export default class ThreadBase extends PureComponent {
|
|||
|
||||
if (props.collapsedThreadsEnabled) {
|
||||
// Without unique id, it breaks navigation from permalink view.
|
||||
this.threadFollowId = Math.floor(Math.random() * 0x10000000000).toString(16);
|
||||
// Adding prefix "!screen" to exclude it from being added to stack
|
||||
this.threadFollowId = '!screen-' + Math.floor(Math.random() * 0x10000000000).toString(16);
|
||||
|
||||
let titleText;
|
||||
if (channelType === General.DM_CHANNEL) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue