Bump app version to 0.5.1 and add auto-update support
- Implemented auto-update logic in `ScribeTopBar` with update notification and user interaction. - Integrated `@tauri-apps/plugin-updater` and `@tauri-apps/plugin-process` for updater functionality. - Added automatic migration feature with `autoMigrateElectron` support and UI feedback. - Refactored app architecture with new routing, components, and layout for better modularity. - Enhanced JSON response handling in API client for robust data parsing. - Updated locales to include new translations for update and migration-related UI.
This commit is contained in:
@@ -25,7 +25,11 @@ async function handleResponse<T>(response: Response): Promise<T> {
|
||||
const body = await response.json().catch(() => ({message: response.statusText}));
|
||||
throw new ApiError(body.message || body || response.statusText, response.status);
|
||||
}
|
||||
return response.json() as Promise<T>;
|
||||
const contentType = response.headers.get('content-type') ?? '';
|
||||
if (contentType.includes('application/json')) {
|
||||
return response.json() as Promise<T>;
|
||||
}
|
||||
return response.text() as unknown as Promise<T>;
|
||||
}
|
||||
|
||||
export async function apiGet<T>(url: string, auth: string, lang: string = "fr", params: Record<string, unknown> = {}): Promise<T> {
|
||||
|
||||
Reference in New Issue
Block a user