This commit is contained in:
seb
2026-10-11 01:44:24 +02:00
parent 78994730d1
commit ce072a3731

View File

@@ -53,7 +53,7 @@ async function fetchAllBrands() {
let offset = 0; let offset = 0;
let total = Infinity; let total = Infinity;
const collected = []; const collected = [];
for (;;) { for (; ;) {
const res = await brandApi.list({ offset, limit: FETCH_PAGE_SIZE }); const res = await brandApi.list({ offset, limit: FETCH_PAGE_SIZE });
if (offset === 0) total = Number(res.total ?? res.brands?.length ?? 0); if (offset === 0) total = Number(res.total ?? res.brands?.length ?? 0);
const page = Array.isArray(res.brands) ? res.brands : []; const page = Array.isArray(res.brands) ? res.brands : [];
@@ -155,7 +155,7 @@ const actions = {
*/ */
async addImage(id, file) { async addImage(id, file) {
const res = await brandApi.addImage(id, file); const res = await brandApi.addImage(id, file);
await brandAutomat.actions.load(); await brandAutomat.actions.reload();
return res.brand; return res.brand;
}, },
@@ -165,7 +165,7 @@ const actions = {
*/ */
async deleteImage(id) { async deleteImage(id) {
const res = await brandApi.deleteImage(id); const res = await brandApi.deleteImage(id);
await brandAutomat.actions.load(); await brandAutomat.actions.reload();
return res.brand; return res.brand;
}, },
@@ -202,12 +202,12 @@ sseAutomat.actions.on('brand', (event) => {
if (payload && typeof payload.sender === 'string' && payload.sender) { if (payload && typeof payload.sender === 'string' && payload.sender) {
try { try {
if (payload.sender === getSseClientId()) return; if (payload.sender === getSseClientId()) return;
} catch {} } catch { }
} }
} catch { } catch {
// Unparseable payload: fall through to reload. // Unparseable payload: fall through to reload.
} }
void brandAutomat.actions.reload().catch(() => {}); void brandAutomat.actions.reload().catch(() => { });
}); });
export default brandAutomat; export default brandAutomat;