mirror of
https://github.com/frappe/books.git
synced 2025-01-03 15:17:30 +00:00
Merge pull request #711 from frappe/fix-kb-issue
fix: prevent back if editing
This commit is contained in:
commit
93da8b5b78
@ -951,7 +951,6 @@ export class Doc extends Observable<DocValue | Doc[]> {
|
||||
return;
|
||||
}
|
||||
|
||||
await this.trigger('beforeCancel');
|
||||
await this.trigger('beforeCancel');
|
||||
await this.setAndSync('cancelled', true);
|
||||
await this.trigger('afterCancel');
|
||||
|
@ -41,7 +41,13 @@ export default function registerIpcMainActionListeners(main: Main) {
|
||||
ipcMain.handle(
|
||||
IPC_ACTIONS.GET_DB_DEFAULT_PATH,
|
||||
async (_, companyName: string) => {
|
||||
let root = app.getPath('documents');
|
||||
let root: string;
|
||||
try {
|
||||
root = app.getPath('documents');
|
||||
} catch {
|
||||
root = app.getPath('userData');
|
||||
}
|
||||
|
||||
if (main.isDevelopment) {
|
||||
root = 'dbs';
|
||||
}
|
||||
|
@ -31,9 +31,15 @@ export function useKeys() {
|
||||
});
|
||||
|
||||
const keydownListener = (e: KeyboardEvent) => {
|
||||
const notMods = !(e.altKey || e.metaKey || e.ctrlKey);
|
||||
if (e.target instanceof HTMLInputElement && notMods) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (
|
||||
e.target instanceof HTMLInputElement &&
|
||||
!(e.altKey || e.metaKey || e.ctrlKey)
|
||||
e.target instanceof HTMLElement &&
|
||||
e.target.contentEditable === 'true' &&
|
||||
notMods
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user