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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
await this.trigger('beforeCancel');
|
|
||||||
await this.trigger('beforeCancel');
|
await this.trigger('beforeCancel');
|
||||||
await this.setAndSync('cancelled', true);
|
await this.setAndSync('cancelled', true);
|
||||||
await this.trigger('afterCancel');
|
await this.trigger('afterCancel');
|
||||||
|
@ -41,7 +41,13 @@ export default function registerIpcMainActionListeners(main: Main) {
|
|||||||
ipcMain.handle(
|
ipcMain.handle(
|
||||||
IPC_ACTIONS.GET_DB_DEFAULT_PATH,
|
IPC_ACTIONS.GET_DB_DEFAULT_PATH,
|
||||||
async (_, companyName: string) => {
|
async (_, companyName: string) => {
|
||||||
let root = app.getPath('documents');
|
let root: string;
|
||||||
|
try {
|
||||||
|
root = app.getPath('documents');
|
||||||
|
} catch {
|
||||||
|
root = app.getPath('userData');
|
||||||
|
}
|
||||||
|
|
||||||
if (main.isDevelopment) {
|
if (main.isDevelopment) {
|
||||||
root = 'dbs';
|
root = 'dbs';
|
||||||
}
|
}
|
||||||
|
@ -31,9 +31,15 @@ export function useKeys() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const keydownListener = (e: KeyboardEvent) => {
|
const keydownListener = (e: KeyboardEvent) => {
|
||||||
|
const notMods = !(e.altKey || e.metaKey || e.ctrlKey);
|
||||||
|
if (e.target instanceof HTMLInputElement && notMods) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
e.target instanceof HTMLInputElement &&
|
e.target instanceof HTMLElement &&
|
||||||
!(e.altKey || e.metaKey || e.ctrlKey)
|
e.target.contentEditable === 'true' &&
|
||||||
|
notMods
|
||||||
) {
|
) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user