fix(collab): a note, poll, message or link that cannot be saved offline says it needs a connection

Collab, packing bags, packing templates and imports, the category a place
form creates and the place imports are not kept on the device, so offline
their writes cannot wait in the queue. They failed with a bare "Error" or the
generic save message. While TREK is offline the failure now reads "This needs
a connection. Try again once TREK is back online.", on desktop and on the
phone's Collab notes; online nothing changes.

Refs #2601
This commit is contained in:
Maurice
2026-10-12 20:18:04 +02:00
parent bdd8c08dd4
commit fee41ab394
14 changed files with 50 additions and 33 deletions
@@ -1,6 +1,7 @@
import { useEffect, useState } from 'react';
import { packingApi } from '../../api/client';
import { offlineOr } from '../../utils/needsConnection';
type Translate = (key: string, params?: Record<string, string | number>) => string;
interface Toaster {
@@ -36,7 +37,7 @@ export function usePackingCategoryAssignees({ tripId, t, toast }: { tripId: numb
const data = await packingApi.setCategoryAssignees(tripId, category, userIds);
setCategoryAssignees((prev) => ({ ...prev, [category]: data.assignees || [] }));
} catch {
toast.error(t('packing.toast.saveError'));
toast.error(offlineOr(t, t('packing.toast.saveError')));
}
};