diff --git a/web/modals/threads/thread-settings-modal.react.js b/web/modals/threads/thread-settings-modal.react.js --- a/web/modals/threads/thread-settings-modal.react.js +++ b/web/modals/threads/thread-settings-modal.react.js @@ -95,6 +95,7 @@ +setQueuedChanges: SetState, +namePlaceholder: string, +changeQueued: boolean, + +setTab: (tabType: TabType) => void, }; class ThreadSettingsModal extends React.PureComponent { nameInput: ?HTMLInputElement; @@ -124,7 +125,7 @@ ); if (!permissionForDeleteTab && prevPermissionForDeleteTab) { - this.setTab('general'); + this.props.setTab('general'); } } @@ -223,7 +224,7 @@ , @@ -244,7 +245,7 @@ , @@ -256,7 +257,7 @@ , @@ -281,10 +282,6 @@ ); } - setTab = (tabType: TabType) => { - this.props.setCurrentTabType(tabType); - }; - nameInputRef = (nameInput: ?HTMLInputElement) => { this.nameInput = nameInput; }; @@ -441,6 +438,10 @@ [queuedChanges], ); + const setTab = React.useCallback((tabType: TabType) => { + setCurrentTabType(tabType); + }, []); + if (!threadInfo) { return ( @@ -472,6 +473,7 @@ setQueuedChanges={setQueuedChanges} namePlaceholder={namePlaceholder} changeQueued={changeQueued} + setTab={setTab} /> ); },