Enhance security and offline functionality
- Implement stricter security measures in the Electron app, including navigation blocking, URL validation, and external request handling. - Add offline mode handling and UI improvements in components like `ScribeFooterBar` and `AddNewBookForm`. - Refactor `DeleteBook` logic to include offline sync methods. - Improve user feedback for online/offline states and synchronization errors.
This commit is contained in:
@@ -3,7 +3,6 @@ import {faTrash} from "@fortawesome/free-solid-svg-icons";
|
||||
import {useContext, useState} from "react";
|
||||
import System from "@/lib/models/System";
|
||||
import {SessionContext} from "@/context/SessionContext";
|
||||
import {BookProps} from "@/lib/models/Book";
|
||||
import {LangContext, LangContextProps} from "@/context/LangContext";
|
||||
import {AlertContext, AlertContextProps} from "@/context/AlertContext";
|
||||
import AlertBox from "@/components/AlertBox";
|
||||
@@ -43,6 +42,9 @@ export default function DeleteBook({bookId}: DeleteBookProps) {
|
||||
id: bookId,
|
||||
});
|
||||
} else {
|
||||
response = await window.electron.invoke<boolean>('db:book:delete', {
|
||||
id: bookId,
|
||||
});
|
||||
response = await System.authDeleteToServer<boolean>(
|
||||
`book/delete`,
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user