Refactor character, chapter, and story components to support offline mode
- Add `OfflineContext` and `BookContext` to components for offline state management. - Introduce conditional logic to toggle between server API requests and offline IPC handlers for CRUD operations. - Refine `TextEditor`, `DraftCompanion`, and other components to disable actions or features unavailable in offline mode. - Improve error handling and user feedback in both online and offline scenarios.
This commit is contained in:
@@ -171,7 +171,7 @@ export default function ComposerRightBar() {
|
||||
<div className="bg-tertiary border-l border-secondary/50 p-3 flex flex-col space-y-3 shadow-xl">
|
||||
{book ? editorComponents
|
||||
.filter((component: PanelComponent):boolean => {
|
||||
return !(isCurrentlyOffline() && component.id === 1);
|
||||
return !((isCurrentlyOffline() || book?.localBook) && component.id === 1);
|
||||
})
|
||||
.map((component: PanelComponent) => (
|
||||
<button
|
||||
|
||||
Reference in New Issue
Block a user