refactor(eq): Enhance EQPage and luxsinApi for improved loading states and debugging
- Introduced a loading indicator for raw curve data in the EQPage to enhance user experience during data fetching. - Added console logging for debugging purposes in luxsinApi when syncing PEQ and posting changes. - Updated related functions to manage loading states effectively, ensuring smoother interactions.
This commit is contained in:
@@ -262,7 +262,11 @@ export class LuxsinAPI {
|
||||
const response = await fetch(`${this.baseUrl}/dev/info.cgi?action=syncPeq`);
|
||||
const text = await response.text();
|
||||
const decoded = decodeCustomBase64(text.trim());
|
||||
return JSON.parse(decoded) as PeqState;
|
||||
const parsed = JSON.parse(decoded) as PeqState;
|
||||
if (import.meta.env.DEV) {
|
||||
console.log("[syncPeq] decoded", parsed);
|
||||
}
|
||||
return parsed;
|
||||
}
|
||||
|
||||
async setPeqFilters(filters: PeqFilter[]): Promise<void> {
|
||||
@@ -281,6 +285,11 @@ export class LuxsinAPI {
|
||||
|
||||
/** POST `json=<custom-base64>` — matches legacy axios `upgradePeq`. */
|
||||
private async postPeqJson(body: PeqChangePayload | PeqApplyPayload): Promise<void> {
|
||||
if (import.meta.env.DEV) {
|
||||
const action =
|
||||
"peqChange" in body ? "peqChange" : "peqApply" in body ? "peqApply" : "peq";
|
||||
console.log(`[dev/info.cgi] POST ${action}`, body);
|
||||
}
|
||||
const encoded = encodeCustomBase64(JSON.stringify(body));
|
||||
const form = new URLSearchParams();
|
||||
form.set("json", encoded);
|
||||
|
||||
Reference in New Issue
Block a user