Changeset View
Changeset View
Standalone View
Standalone View
web/modals/threads/settings/thread-settings-modal.react.js
Show First 20 Lines • Show All 118 Lines • ▼ Show 20 Lines | React.useEffect(() => { | ||||
threadInfo && | threadInfo && | ||||
currentTabType !== 'general' && | currentTabType !== 'general' && | ||||
!hasPermissionForTab(threadInfo, currentTabType) | !hasPermissionForTab(threadInfo, currentTabType) | ||||
) { | ) { | ||||
setCurrentTabType('general'); | setCurrentTabType('general'); | ||||
} | } | ||||
}, [currentTabType, hasPermissionForTab, threadInfo]); | }, [currentTabType, hasPermissionForTab, threadInfo]); | ||||
React.useEffect(() => setErrorMessage(''), [currentTabType]); | |||||
tomek: For me it would make a little more sense to clear on exit instead of enter | |||||
if (!threadInfo) { | if (!threadInfo) { | ||||
return ( | return ( | ||||
<Modal onClose={modalContext.popModal} name="Invalid chat"> | <Modal onClose={modalContext.popModal} name="Invalid chat"> | ||||
<div className={css.modal_body}> | <div className={css.modal_body}> | ||||
<p>You no longer have permission to view this chat</p> | <p>You no longer have permission to view this chat</p> | ||||
</div> | </div> | ||||
</Modal> | </Modal> | ||||
); | ); | ||||
▲ Show 20 Lines • Show All 93 Lines • Show Last 20 Lines |
For me it would make a little more sense to clear on exit instead of enter