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:
@@ -321,8 +321,10 @@ export function handleUpdateLastActive(event: IpcMainEvent, serverName: string,
|
||||
team.lastActiveTab = viewOrder;
|
||||
}
|
||||
});
|
||||
Config.set('teams', teams);
|
||||
Config.set('lastActiveTeam', teams.find((team) => team.name === serverName)?.order || 0);
|
||||
Config.setMultiple({
|
||||
teams,
|
||||
lastActiveTeam: teams.find((team) => team.name === serverName)?.order || 0,
|
||||
});
|
||||
}
|
||||
|
||||
export function handlePingDomain(event: IpcMainInvokeEvent, url: string): Promise<string> {
|
||||
|
Reference in New Issue
Block a user