mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-14 00:01:03 +00:00
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:
@@ -2,6 +2,7 @@ import { useMemo, useState, type ChangeEvent } from 'react';
|
||||
|
||||
import { packingApi } from '../../api/client';
|
||||
import { useTripStore } from '../../store/tripStore';
|
||||
import { offlineOr } from '../../utils/needsConnection';
|
||||
import { parseImportLines } from './packingListPanel.helpers';
|
||||
|
||||
type Translate = (key: string, params?: Record<string, string | number>) => string;
|
||||
@@ -66,7 +67,7 @@ export function usePackingImport({
|
||||
setText('');
|
||||
onImported();
|
||||
} catch {
|
||||
toast.error(t('packing.importError'));
|
||||
toast.error(offlineOr(t, t('packing.importError')));
|
||||
} finally {
|
||||
if (oneAtATime) setImporting(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user