Add offline mode logic for book, story, and world operations
- Integrate `OfflineContext` into book, story settings, and related components. - Add conditional logic to toggle between server API requests and offline IPC handlers (`db:book:delete`, `db:book:story:get`, `db:location:all`, etc.). - Refactor and update IPC handlers to accept structured data arguments for improved consistency (`data: object`). - Ensure stricter typings in IPC handlers and frontend functions. - Improve error handling and user feedback in both online and offline modes.
This commit is contained in:
@@ -148,9 +148,12 @@ ipcMain.handle('db:chapter:information:add', createHandler<AddChapterInformation
|
||||
);
|
||||
|
||||
// DELETE /chapter/resume/remove - Remove chapter information
|
||||
ipcMain.handle('db:chapter:information:remove', createHandler<string, boolean>(
|
||||
function(userId: string, chapterInfoId: string, lang: 'fr' | 'en'): boolean {
|
||||
return Chapter.removeChapterInformation(userId, chapterInfoId, lang);
|
||||
interface RemoveChapterInfoData {
|
||||
chapterInfoId: string;
|
||||
}
|
||||
ipcMain.handle('db:chapter:information:remove', createHandler<RemoveChapterInfoData, boolean>(
|
||||
function(userId: string, data: RemoveChapterInfoData, lang: 'fr' | 'en'): boolean {
|
||||
return Chapter.removeChapterInformation(userId, data.chapterInfoId, lang);
|
||||
}
|
||||
)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user