mirror of
https://github.com/dbgate/dbgate
synced 2024-11-07 20:26:23 +00:00
open dev tools on crash, when not reloading
This commit is contained in:
parent
4c2f6c9b65
commit
b8206a7a02
@ -102,6 +102,9 @@ ipcMain.on('set-title', async (event, arg) => {
|
|||||||
ipcMain.on('open-link', async (event, arg) => {
|
ipcMain.on('open-link', async (event, arg) => {
|
||||||
electron.shell.openExternal(arg);
|
electron.shell.openExternal(arg);
|
||||||
});
|
});
|
||||||
|
ipcMain.on('open-dev-tools', () => {
|
||||||
|
mainWindow.webContents.openDevTools();
|
||||||
|
});
|
||||||
ipcMain.on('window-action', async (event, arg) => {
|
ipcMain.on('window-action', async (event, arg) => {
|
||||||
switch (arg) {
|
switch (arg) {
|
||||||
case 'minimize':
|
case 'minimize':
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import localforage from 'localforage';
|
import localforage from 'localforage';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
|
import getElectron from './getElectron';
|
||||||
import { getLocalStorage, setLocalStorage } from './storageCache';
|
import { getLocalStorage, setLocalStorage } from './storageCache';
|
||||||
|
|
||||||
let counter = 0;
|
let counter = 0;
|
||||||
@ -41,6 +42,8 @@
|
|||||||
// console.error('Error clearing app data', err);
|
// console.error('Error clearing app data', err);
|
||||||
// }
|
// }
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
|
} else {
|
||||||
|
getElectron()?.send('open-dev-tools');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (
|
if (
|
||||||
@ -50,6 +53,8 @@
|
|||||||
) {
|
) {
|
||||||
localStorage.setItem('lastDbGateCrash', JSON.stringify(new Date().getTime()));
|
localStorage.setItem('lastDbGateCrash', JSON.stringify(new Date().getTime()));
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
|
} else {
|
||||||
|
getElectron()?.send('open-dev-tools');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user