Update database schema and synchronization logic

- Add `useEffect` in `ScribeLeftBar` for handling book state changes.
- Extend `BooksSyncContext` with new properties and stricter typings.
- Refine `Repositories` to include `lastUpdate` handling for synchronization processes.
- Add comprehensive `fetchComplete*` repository methods for retrieving entity-specific sync data.
- Enhance offline logic for chapters, characters, locations, and world synchronization.
- Improve error handling across IPC handlers and repositories.
This commit is contained in:
natreex
2025-12-15 20:55:24 -05:00
parent bb331b5c22
commit 64c7cb6243
23 changed files with 1609 additions and 79 deletions

View File

@@ -36,6 +36,7 @@ export default function ScribeChapterComponent() {
const scrollContainerRef = useRef<HTMLUListElement>(null);
useEffect((): void => {
if (book)
getChapterList().then();
}, [book]);

View File

@@ -1,6 +1,6 @@
import {FontAwesomeIcon} from "@fortawesome/react-fontawesome";
import {faBookMedical, faBookOpen, faFeather} from "@fortawesome/free-solid-svg-icons";
import {useContext, useState} from "react";
import {useContext, useEffect, useState} from "react";
import {BookContext} from "@/context/BookContext";
import ScribeChapterComponent from "@/components/leftbar/ScribeChapterComponent";
import PanelHeader from "@/components/PanelHeader";
@@ -75,6 +75,14 @@ export default function ScribeLeftBar() {
}
}
useEffect(():void => {
if (!book){
setCurrentPanel(undefined);
setPanelHidden(false);
return;
}
}, [book]);
return (
<div id="left-panel-container" data-guide={"left-panel-container"} className="flex transition-all duration-300">
<div className="bg-tertiary border-r border-secondary/50 p-3 flex flex-col space-y-3 shadow-xl">