[MM-38524] Rework the closing and opening tab logic, fixed login issue (#1735)
* Rework the closing and opening tab logic to better suit adding and removing servers * A couple more fixes * Lint fix * [MM-38524] Fix login issue * Remove unneeded code
This commit is contained in:
@@ -104,8 +104,8 @@ export default class MainPage extends React.PureComponent<Props, State> {
|
||||
|
||||
const firstServer = this.props.teams.find((team) => team.order === this.props.lastActiveTeam || 0);
|
||||
let firstTab = firstServer?.tabs.find((tab) => tab.order === firstServer.lastActiveTab || 0);
|
||||
if (firstTab?.isClosed) {
|
||||
const openTabs = firstServer?.tabs.filter((tab) => !tab.isClosed) || [];
|
||||
if (!firstTab?.isOpen) {
|
||||
const openTabs = firstServer?.tabs.filter((tab) => tab.isOpen) || [];
|
||||
firstTab = openTabs?.find((e) => e.order === 0) || openTabs[0];
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user