[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:
@@ -11,6 +11,7 @@ import {AppState} from 'types/appState';
|
||||
import {ComparableCertificate} from 'types/certificate';
|
||||
import {PermissionType, TrustedOrigin} from 'types/trustedOrigin';
|
||||
|
||||
import {TAB_MESSAGING} from 'common/tabs/TabView';
|
||||
import urlUtils from 'common/utils/url';
|
||||
|
||||
const defaultOptions = {
|
||||
@@ -103,7 +104,7 @@ const configDataSchemaV3 = Joi.object<ConfigV3>({
|
||||
tabs: Joi.array().items(Joi.object({
|
||||
name: Joi.string().required(),
|
||||
order: Joi.number().integer().min(0),
|
||||
isClosed: Joi.boolean().default(false),
|
||||
isOpen: Joi.boolean(),
|
||||
})).default([]),
|
||||
})).default([]),
|
||||
showTrayIcon: Joi.boolean().default(false),
|
||||
@@ -226,6 +227,14 @@ export function validateV3ConfigData(data: ConfigV3) {
|
||||
return {
|
||||
...team,
|
||||
url: cleanURL(team.url),
|
||||
|
||||
// Force messaging to stay open regardless of user config
|
||||
tabs: team.tabs.map((tab) => {
|
||||
return {
|
||||
...tab,
|
||||
isOpen: tab.name === TAB_MESSAGING ? true : tab.isOpen,
|
||||
};
|
||||
}),
|
||||
};
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user