Integrate local database management and IPC handlers into Electron
- Add comprehensive IPC handlers for database operations like books, chapters, characters, and conversations. - Implement local database initialization and user data encryption. - Update preload script paths for consistent environment handling. - Modify `page.tsx` to initialize local database within Electron environment. - Add new dependencies including `node-sqlite3-wasm` and `electron-rebuild`.
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
import {useContext} from "react";
|
||||
import {BookContext, BookContextProps} from "@/context/BookContext";
|
||||
import {useTranslations} from "next-intl";
|
||||
import OfflineToggle from "@/components/offline/OfflineToggle";
|
||||
|
||||
export default function ScribeTopBar() {
|
||||
const book: BookContextProps = useContext(BookContext);
|
||||
@@ -33,6 +34,7 @@ export default function ScribeTopBar() {
|
||||
</div>
|
||||
)}
|
||||
<div className="flex items-center space-x-2 min-w-[120px] justify-end">
|
||||
<OfflineToggle />
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
||||
@@ -244,8 +244,8 @@ export default function BookList() {
|
||||
<div
|
||||
className="flex justify-between items-center w-full max-w-5xl mx-auto mb-6 px-6">
|
||||
<h2 className="text-3xl text-text-primary capitalize font-['ADLaM_Display'] flex items-center gap-3">
|
||||
<span className="w-1 h-8 bg-primary rounded-full"></span>
|
||||
{category}
|
||||
<span key="icon" className="w-1 h-8 bg-primary rounded-full"></span>
|
||||
<span key="title">{category}</span>
|
||||
</h2>
|
||||
<span
|
||||
className="text-muted text-lg font-medium bg-secondary/30 px-4 py-1.5 rounded-full">{books.length} {t("bookList.works")}</span>
|
||||
|
||||
Reference in New Issue
Block a user