mirror of
https://github.com/zulip/zulip-desktop.git
synced 2025-11-18 12:43:02 +00:00
db: Fix JSON db errors on tab switch.
This commit is contained in:
committed by
Akash Nimare
parent
88b764dcc9
commit
db4e8e5129
@@ -354,6 +354,10 @@ app.on('ready', () => {
|
||||
ipcMain.on('error-reporting', event => {
|
||||
event.sender.send('error-reporting-val', errorReporting);
|
||||
});
|
||||
|
||||
ipcMain.on('save-last-tab', (event, index) => {
|
||||
ConfigUtil.setConfigItem('lastActiveTab', index);
|
||||
});
|
||||
});
|
||||
|
||||
app.on('before-quit', () => {
|
||||
|
||||
@@ -409,8 +409,8 @@ class ServerManagerView {
|
||||
activateLastTab(index) {
|
||||
// Open all the tabs in background, also activate the tab based on the index
|
||||
this.activateTab(index);
|
||||
// Save last active tab
|
||||
ConfigUtil.setConfigItem('lastActiveTab', index);
|
||||
// Save last active tab via main process to avoid JSON DB errors
|
||||
ipcRenderer.send('save-last-tab', index);
|
||||
}
|
||||
|
||||
// returns this.tabs in an way that does
|
||||
|
||||
Reference in New Issue
Block a user