mirror of
https://github.com/zulip/zulip-desktop.git
synced 2025-11-20 14:38:26 +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 => {
|
ipcMain.on('error-reporting', event => {
|
||||||
event.sender.send('error-reporting-val', errorReporting);
|
event.sender.send('error-reporting-val', errorReporting);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
ipcMain.on('save-last-tab', (event, index) => {
|
||||||
|
ConfigUtil.setConfigItem('lastActiveTab', index);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
app.on('before-quit', () => {
|
app.on('before-quit', () => {
|
||||||
|
|||||||
@@ -409,8 +409,8 @@ class ServerManagerView {
|
|||||||
activateLastTab(index) {
|
activateLastTab(index) {
|
||||||
// Open all the tabs in background, also activate the tab based on the index
|
// Open all the tabs in background, also activate the tab based on the index
|
||||||
this.activateTab(index);
|
this.activateTab(index);
|
||||||
// Save last active tab
|
// Save last active tab via main process to avoid JSON DB errors
|
||||||
ConfigUtil.setConfigItem('lastActiveTab', index);
|
ipcRenderer.send('save-last-tab', index);
|
||||||
}
|
}
|
||||||
|
|
||||||
// returns this.tabs in an way that does
|
// returns this.tabs in an way that does
|
||||||
|
|||||||
Reference in New Issue
Block a user