mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-27 07:07:31 +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:
@@ -5,6 +5,7 @@ import { useTripStore } from '../../store/tripStore'
|
||||
import { useToast } from '../shared/Toast'
|
||||
import { useTranslation } from '../../i18n'
|
||||
import { PackingTemplateOption } from './PackingTemplateOption'
|
||||
import { offlineOr } from '../../utils/needsConnection'
|
||||
|
||||
interface Template {
|
||||
id: number
|
||||
@@ -50,7 +51,7 @@ export default function ApplyTemplateButton({ tripId, visibility, style, classNa
|
||||
toast.success(t('packing.templateApplied', { count: data.count }))
|
||||
setOpen(false)
|
||||
} catch {
|
||||
toast.error(t('packing.templateError'))
|
||||
toast.error(offlineOr(t, t('packing.templateError')))
|
||||
} finally {
|
||||
setApplying(false)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user