Reduce the number of writes to the config (#2498)
* Add some logging, refactor setting config items * Move active team to setMultiple, reduce serverInfos calls if the data is already the same * Fix some logging * Lint fix
This commit is contained in:
@@ -127,6 +127,8 @@ export class ViewManager {
|
||||
* close, open, or reload tabs, taking care to reuse tabs and
|
||||
* preserve focus on the currently selected tab. */
|
||||
reloadConfiguration = (configServers: TeamWithTabs[]) => {
|
||||
log.debug('viewManager.reloadConfiguration');
|
||||
|
||||
const focusedTuple: TabTuple | undefined = this.views.get(this.currentView as string)?.urlTypeTuple;
|
||||
|
||||
const current: Map<TabTuple, MattermostView> = new Map();
|
||||
@@ -199,6 +201,8 @@ export class ViewManager {
|
||||
}
|
||||
|
||||
showInitial = () => {
|
||||
log.verbose('viewManager.showInitial');
|
||||
|
||||
const servers = this.getServers();
|
||||
if (servers.length) {
|
||||
const element = servers.find((e) => e.order === this.lastActiveServer) || servers.find((e) => e.order === 0);
|
||||
|
Reference in New Issue
Block a user