Add error handling, enhance syncing, and refactor deletion logic
- Introduce new error messages for syncing and book deletion in `en.json`. - Update `DeleteBook` to support local-only deletion and synced book management. - Refine offline/online behavior with `deleteLocalToo` checkbox and update related state handling. - Extend repository and IPC methods to handle optional IDs for updates. - Add `SyncQueueContext` for queueing offline changes and improving synchronization workflows. - Enhance refined text generation logic in `DraftCompanion` and `GhostWriter` components. - Replace PUT with PATCH for world updates to align with API expectations. - Streamline `AlertBox` by integrating dynamic translation keys for deletion prompts.
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
import axios, {AxiosResponse} from "axios";
|
||||
import {configs} from "@/lib/configs";
|
||||
import * as electron from "electron";
|
||||
import * as os from "node:os";
|
||||
|
||||
export default class System{
|
||||
static verifyInput(input: string): boolean {
|
||||
@@ -36,7 +34,7 @@ export default class System{
|
||||
},
|
||||
params: {
|
||||
lang: lang,
|
||||
plateforme: os.platform(),
|
||||
plateforme: window.electron.platform,
|
||||
...params
|
||||
},
|
||||
url: configs.apiUrl + url,
|
||||
@@ -77,7 +75,7 @@ export default class System{
|
||||
},
|
||||
params: {
|
||||
lang: lang,
|
||||
plateforme: os.platform(),
|
||||
plateforme: window.electron.platform,
|
||||
},
|
||||
url: configs.apiUrl + url,
|
||||
data: data
|
||||
@@ -105,7 +103,7 @@ export default class System{
|
||||
},
|
||||
params: {
|
||||
lang: lang,
|
||||
plateforme: os.platform(),
|
||||
plateforme: window.electron.platform,
|
||||
},
|
||||
url: configs.apiUrl + url,
|
||||
data: data
|
||||
@@ -133,7 +131,7 @@ export default class System{
|
||||
url: configs.apiUrl + url,
|
||||
params: {
|
||||
lang: lang,
|
||||
plateforme: os.platform(),
|
||||
plateforme: window.electron.platform,
|
||||
},
|
||||
data: data
|
||||
})
|
||||
@@ -161,7 +159,7 @@ export default class System{
|
||||
url: configs.apiUrl + url,
|
||||
params: {
|
||||
lang: lang,
|
||||
plateforme: os.platform(),
|
||||
plateforme: window.electron.platform,
|
||||
},
|
||||
data: data
|
||||
})
|
||||
@@ -220,7 +218,7 @@ export default class System{
|
||||
url: configs.apiUrl + url,
|
||||
params: {
|
||||
lang: lang,
|
||||
plateforme: os.platform(),
|
||||
plateforme: window.electron.platform,
|
||||
},
|
||||
data: data
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user