mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-27 23:27:31 +00:00
fix: mark deliberately unawaited promises with void (Sonar S9383)
This commit is contained in:
@@ -50,7 +50,7 @@ export async function fetchImageAsBlob(url: string): Promise<string> {
|
||||
}
|
||||
if (active < MAX_CONCURRENT) {
|
||||
active++
|
||||
run()
|
||||
void run()
|
||||
} else {
|
||||
queue.push(run)
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ function scheduleReconnect(): void {
|
||||
reconnectTimer = setTimeout(() => {
|
||||
reconnectTimer = null
|
||||
if (shouldReconnect) {
|
||||
connectInternal(true)
|
||||
void connectInternal(true)
|
||||
}
|
||||
}, reconnectDelay)
|
||||
reconnectDelay = Math.min(reconnectDelay * 2, MAX_RECONNECT_DELAY)
|
||||
@@ -141,7 +141,7 @@ async function connectInternal(_isReconnect = false): Promise<void> {
|
||||
// Flush queued mutations first so local writes land before server read-back.
|
||||
// If the hook fails, still refetch to keep the UI correct.
|
||||
if (preReconnectHook) {
|
||||
preReconnectHook().catch(console.error).then(doRefetch)
|
||||
void preReconnectHook().catch(console.error).then(doRefetch)
|
||||
} else {
|
||||
doRefetch()
|
||||
}
|
||||
@@ -170,7 +170,7 @@ export function connect(): void {
|
||||
clearTimeout(reconnectTimer)
|
||||
reconnectTimer = null
|
||||
}
|
||||
connectInternal(false)
|
||||
void connectInternal(false)
|
||||
}
|
||||
|
||||
export function disconnect(): void {
|
||||
|
||||
@@ -114,7 +114,7 @@ export default function AddonManager({ bagTrackingEnabled, onToggleBagTracking,
|
||||
const [loading, setLoading] = useState(true)
|
||||
|
||||
useEffect(() => {
|
||||
loadAddons().finally(() => setLoading(false))
|
||||
void loadAddons().finally(() => setLoading(false))
|
||||
}, [])
|
||||
|
||||
const loadAddons = async () => {
|
||||
@@ -410,7 +410,7 @@ function LlmParsingConfig({ addon }: { addon: Addon }) {
|
||||
|
||||
// Load installed models when the local provider is active.
|
||||
useEffect(() => {
|
||||
if (provider === 'local') loadModels()
|
||||
if (provider === 'local') void loadModels()
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [provider])
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ export default function BackupPanel() {
|
||||
} catch {}
|
||||
}
|
||||
|
||||
useEffect(() => { loadBackups(); loadAutoSettings() }, [])
|
||||
useEffect(() => { void loadBackups(); void loadAutoSettings() }, [])
|
||||
|
||||
const handleCreate = async () => {
|
||||
setIsCreating(true)
|
||||
|
||||
@@ -25,7 +25,7 @@ export default function CategoryManager() {
|
||||
const toast = useToast()
|
||||
const { t } = useTranslation()
|
||||
|
||||
useEffect(() => { loadCategories() }, [])
|
||||
useEffect(() => { void loadCategories() }, [])
|
||||
|
||||
const loadCategories = async () => {
|
||||
setIsLoading(true)
|
||||
|
||||
@@ -218,7 +218,7 @@ export default function DefaultUserSettingsTab(): React.ReactElement {
|
||||
setMapboxStyle(nextStyle)
|
||||
patch[styleSettingKey(nextProvider)] = nextStyle
|
||||
}
|
||||
save(patch)
|
||||
void save(patch)
|
||||
}
|
||||
|
||||
return (
|
||||
@@ -320,7 +320,7 @@ export default function DefaultUserSettingsTab(): React.ReactElement {
|
||||
</label>
|
||||
<CustomSelect
|
||||
value={defaults.default_currency || ''}
|
||||
onChange={(value: string) => { if (value) save({ default_currency: value }) }}
|
||||
onChange={(value: string) => { if (value) void save({ default_currency: value }) }}
|
||||
placeholder={t('settings.currency')}
|
||||
searchable
|
||||
options={currenciesWith(defaults.default_currency).map(c => ({ value: c, label: SYMBOLS[c] ? `${c} ${SYMBOLS[c]}` : c }))}
|
||||
@@ -356,7 +356,7 @@ export default function DefaultUserSettingsTab(): React.ReactElement {
|
||||
</label>
|
||||
<CustomSelect
|
||||
value={mapTileUrl}
|
||||
onChange={(value: string) => { if (value) { setMapTileUrl(value); save({ map_tile_url: value }) } }}
|
||||
onChange={(value: string) => { if (value) { setMapTileUrl(value); void save({ map_tile_url: value }) } }}
|
||||
placeholder={t('settings.mapTemplatePlaceholder.select')}
|
||||
options={MAP_PRESETS.map(p => ({ value: p.url, label: p.name }))}
|
||||
size="sm"
|
||||
@@ -473,7 +473,7 @@ export default function DefaultUserSettingsTab(): React.ReactElement {
|
||||
</label>
|
||||
<CustomSelect
|
||||
value={mapboxStyle}
|
||||
onChange={(value: string) => { if (value) { setMapboxStyle(value); save({ [styleKey]: value }) } }}
|
||||
onChange={(value: string) => { if (value) { setMapboxStyle(value); void save({ [styleKey]: value }) } }}
|
||||
placeholder={t('admin.defaultSettings.mapboxStylePlaceholder')}
|
||||
options={glStylePresets.map(p => ({ value: p.url, label: p.name }))}
|
||||
size="sm"
|
||||
@@ -486,7 +486,7 @@ export default function DefaultUserSettingsTab(): React.ReactElement {
|
||||
onBlur={() => {
|
||||
const nextStyle = normalizeStyleForProvider(mapProvider, mapboxStyle)
|
||||
setMapboxStyle(nextStyle)
|
||||
save({ [styleKey]: nextStyle })
|
||||
void save({ [styleKey]: nextStyle })
|
||||
}}
|
||||
placeholder={defaultStyleForProvider(mapProvider)}
|
||||
className="w-full px-3 py-2 border border-slate-300 rounded-lg text-sm focus:ring-2 focus:ring-slate-400 focus:border-transparent"
|
||||
|
||||
@@ -53,7 +53,7 @@ export default function GitHubPanel({ isPrerelease = false }: { isPrerelease?: b
|
||||
|
||||
useEffect(() => {
|
||||
setLoading(true);
|
||||
fetchReleases(1).finally(() => setLoading(false));
|
||||
void fetchReleases(1).finally(() => setLoading(false));
|
||||
}, []);
|
||||
|
||||
const handleLoadMore = async () => {
|
||||
|
||||
@@ -46,7 +46,7 @@ export default function PackingTemplateManager() {
|
||||
const toast = useToast()
|
||||
const { t } = useTranslation()
|
||||
|
||||
useEffect(() => { loadTemplates() }, [])
|
||||
useEffect(() => { void loadTemplates() }, [])
|
||||
|
||||
const loadTemplates = async () => {
|
||||
setIsLoading(true)
|
||||
@@ -178,7 +178,7 @@ export default function PackingTemplateManager() {
|
||||
<div className="px-5 py-3 border-b border-slate-100 flex items-center gap-3">
|
||||
<Package size={16} className="text-slate-400 flex-shrink-0" />
|
||||
<input autoFocus value={createName} onChange={e => setCreateName(e.target.value)}
|
||||
onKeyDown={e => { if (e.key === 'Enter') handleCreateTemplate(); if (e.key === 'Escape') setShowCreate(false) }}
|
||||
onKeyDown={e => { if (e.key === 'Enter') void handleCreateTemplate(); if (e.key === 'Escape') setShowCreate(false) }}
|
||||
placeholder={t('admin.packingTemplates.namePlaceholder')} className={inputStyle} />
|
||||
<button type="button" onClick={handleCreateTemplate} className={`${btnIcon} text-slate-600 hover:text-slate-900`}><Check size={16} /></button>
|
||||
<button type="button" onClick={() => setShowCreate(false)} className={`${btnIcon} text-slate-400 hover:text-slate-600`}><X size={16} /></button>
|
||||
@@ -203,7 +203,7 @@ export default function PackingTemplateManager() {
|
||||
{editingTemplate === tmpl.id ? (
|
||||
<input autoFocus value={editTemplateName} onChange={e => setEditTemplateName(e.target.value)}
|
||||
onBlur={() => handleRenameTemplate(tmpl.id)}
|
||||
onKeyDown={e => { if (e.key === 'Enter') handleRenameTemplate(tmpl.id); if (e.key === 'Escape') setEditingTemplate(null) }}
|
||||
onKeyDown={e => { if (e.key === 'Enter') void handleRenameTemplate(tmpl.id); if (e.key === 'Escape') setEditingTemplate(null) }}
|
||||
className="flex-1 px-2 py-0.5 border border-slate-300 rounded text-sm" />
|
||||
) : (
|
||||
<button type="button" onClick={() => toggleExpand(tmpl.id)} className="flex-1 text-left bg-transparent border-0 p-0 text-sm font-medium text-slate-700 cursor-pointer">{tmpl.name}</button>
|
||||
@@ -230,7 +230,7 @@ export default function PackingTemplateManager() {
|
||||
<>
|
||||
<input autoFocus value={editCatName} onChange={e => setEditCatName(e.target.value)}
|
||||
onBlur={() => handleRenameCategory(cat.id)}
|
||||
onKeyDown={e => { if (e.key === 'Enter') handleRenameCategory(cat.id); if (e.key === 'Escape') setEditingCatId(null) }}
|
||||
onKeyDown={e => { if (e.key === 'Enter') void handleRenameCategory(cat.id); if (e.key === 'Escape') setEditingCatId(null) }}
|
||||
className="flex-1 px-2 py-0.5 border border-slate-300 rounded text-sm font-semibold" />
|
||||
</>
|
||||
) : (
|
||||
@@ -253,7 +253,7 @@ export default function PackingTemplateManager() {
|
||||
{editingItemId === item.id ? (
|
||||
<>
|
||||
<input autoFocus value={editItemName} onChange={e => setEditItemName(e.target.value)}
|
||||
onKeyDown={e => { if (e.key === 'Enter') handleRenameItem(item.id); if (e.key === 'Escape') setEditingItemId(null) }}
|
||||
onKeyDown={e => { if (e.key === 'Enter') void handleRenameItem(item.id); if (e.key === 'Escape') setEditingItemId(null) }}
|
||||
className="flex-1 px-2 py-1 border border-slate-200 rounded-lg text-sm" />
|
||||
<button type="button" onClick={() => handleRenameItem(item.id)} className="p-1 text-slate-600 hover:text-slate-900"><Check size={13} /></button>
|
||||
<button type="button" onClick={() => setEditingItemId(null)} className="p-1 text-slate-400"><X size={13} /></button>
|
||||
@@ -277,7 +277,7 @@ export default function PackingTemplateManager() {
|
||||
{addingItemToCatId === cat.id && (
|
||||
<div className="flex items-center gap-2 px-4 py-2">
|
||||
<input ref={addItemRef} value={newItemName} onChange={e => setNewItemName(e.target.value)}
|
||||
onKeyDown={e => { if (e.key === 'Enter' && newItemName.trim()) handleAddItem(cat.id); if (e.key === 'Escape') { setAddingItemToCatId(null); setNewItemName('') } }}
|
||||
onKeyDown={e => { if (e.key === 'Enter' && newItemName.trim()) void handleAddItem(cat.id); if (e.key === 'Escape') { setAddingItemToCatId(null); setNewItemName('') } }}
|
||||
placeholder={t('admin.packingTemplates.itemName')}
|
||||
className="flex-1 px-2 py-1 border border-slate-200 rounded-lg text-sm" />
|
||||
<button type="button" onClick={() => handleAddItem(cat.id)} disabled={!newItemName.trim()}
|
||||
@@ -296,7 +296,7 @@ export default function PackingTemplateManager() {
|
||||
{addingCategory ? (
|
||||
<div className="flex items-center gap-2">
|
||||
<input autoFocus value={newCatName} onChange={e => setNewCatName(e.target.value)}
|
||||
onKeyDown={e => { if (e.key === 'Enter') handleAddCategory(); if (e.key === 'Escape') { setAddingCategory(false); setNewCatName('') } }}
|
||||
onKeyDown={e => { if (e.key === 'Enter') void handleAddCategory(); if (e.key === 'Escape') { setAddingCategory(false); setNewCatName('') } }}
|
||||
placeholder={t('admin.packingTemplates.categoryName')}
|
||||
className="flex-1 px-3 py-2 border border-slate-200 rounded-lg text-sm" />
|
||||
<button type="button" onClick={handleAddCategory} className={`${btnIcon} text-slate-600 hover:text-slate-900`}><Check size={15} /></button>
|
||||
|
||||
@@ -38,7 +38,7 @@ export default function PermissionsPanel(): React.ReactElement {
|
||||
const [dirty, setDirty] = useState(false)
|
||||
|
||||
useEffect(() => {
|
||||
loadPermissions()
|
||||
void loadPermissions()
|
||||
}, [])
|
||||
|
||||
const loadPermissions = async () => {
|
||||
|
||||
@@ -79,7 +79,7 @@ export default function BudgetCategoryTable({ cat, grouped, categoryColor, canEd
|
||||
const toIdx = newOrder.indexOf(cat)
|
||||
newOrder.splice(fromIdx, 1)
|
||||
newOrder.splice(toIdx, 0, dragCat)
|
||||
reorderBudgetCategories(tripId, newOrder)
|
||||
void reorderBudgetCategories(tripId, newOrder)
|
||||
}
|
||||
setDragCat(null); setDragOverCat(null)
|
||||
}}
|
||||
@@ -103,8 +103,8 @@ export default function BudgetCategoryTable({ cat, grouped, categoryColor, canEd
|
||||
autoFocus
|
||||
value={editingCat.value}
|
||||
onChange={e => setEditingCat({ ...editingCat, value: e.target.value })}
|
||||
onBlur={() => { handleRenameCategory(cat, editingCat.value); setEditingCat(null) }}
|
||||
onKeyDown={e => { if (e.key === 'Enter') { handleRenameCategory(cat, editingCat.value); setEditingCat(null) } if (e.key === 'Escape') setEditingCat(null) }}
|
||||
onBlur={() => { void handleRenameCategory(cat, editingCat.value); setEditingCat(null) }}
|
||||
onKeyDown={e => { if (e.key === 'Enter') { void handleRenameCategory(cat, editingCat.value); setEditingCat(null) } if (e.key === 'Escape') setEditingCat(null) }}
|
||||
style={{ fontWeight: 600, fontSize: 'calc(13px * var(--fs-scale-body, 1))', background: 'rgba(255,255,255,0.15)', border: 'none', borderRadius: 4, color: '#fff', padding: '1px 6px', outline: 'none', fontFamily: 'inherit', width: '100%' }}
|
||||
/>
|
||||
) : (
|
||||
@@ -180,7 +180,7 @@ export default function BudgetCategoryTable({ cat, grouped, categoryColor, canEd
|
||||
const toIdx = ids.indexOf(item.id)
|
||||
ids.splice(fromIdx, 1)
|
||||
ids.splice(toIdx, 0, dragItem)
|
||||
reorderBudgetItems(tripId, ids)
|
||||
void reorderBudgetItems(tripId, ids)
|
||||
setDragItem(null); setDragOverItem(null); setDragItemCat(null)
|
||||
}
|
||||
}}
|
||||
|
||||
@@ -4,7 +4,7 @@ import { getAuthUrl } from '../../api/authUrl'
|
||||
export function AuthedImg({ src, style, onClick, onMouseEnter, onMouseLeave, alt }: { src: string; style?: React.CSSProperties; onClick?: () => void; onMouseEnter?: React.MouseEventHandler<HTMLElement>; onMouseLeave?: React.MouseEventHandler<HTMLElement>; alt?: string }) {
|
||||
const [authSrc, setAuthSrc] = useState('')
|
||||
useEffect(() => {
|
||||
getAuthUrl(src, 'download').then(setAuthSrc)
|
||||
void getAuthUrl(src, 'download').then(setAuthSrc)
|
||||
}, [src])
|
||||
if (!authSrc) return null
|
||||
// A clickable thumbnail gets a real button around the image so it is
|
||||
|
||||
@@ -53,7 +53,7 @@ export function NoteCard({ note, canEdit, onUpdate, onDelete, onEdit, onView, on
|
||||
const menu = useContextMenu()
|
||||
|
||||
const handleTogglePin = useCallback(() => {
|
||||
onUpdate(note.id, { pinned: !note.pinned })
|
||||
void onUpdate(note.id, { pinned: !note.pinned })
|
||||
}, [note.id, note.pinned, onUpdate])
|
||||
|
||||
const handleDelete = useCallback(() => {
|
||||
|
||||
@@ -25,7 +25,7 @@ export function FilePreviewPortal({ file, onClose }: FilePreviewPortalProps) {
|
||||
useEffect(() => {
|
||||
setAuthUrl('')
|
||||
if (!rawUrl) return
|
||||
getAuthUrl(rawUrl, 'download').then(setAuthUrl)
|
||||
void getAuthUrl(rawUrl, 'download').then(setAuthUrl)
|
||||
}, [rawUrl])
|
||||
|
||||
const isImage = !!file?.mime_type?.startsWith('image/')
|
||||
|
||||
@@ -205,7 +205,7 @@ export default function AddPlaceToCollectionModal({ isOpen, collectionId, collec
|
||||
type="text"
|
||||
value={query}
|
||||
onChange={e => { setQuery(e.target.value); setNoResults(false) }}
|
||||
onKeyDown={e => { if (e.key === 'Enter') { e.preventDefault(); search() } }}
|
||||
onKeyDown={e => { if (e.key === 'Enter') { e.preventDefault(); void search() } }}
|
||||
aria-label={t('collections.addPlaceSearch')}
|
||||
placeholder={t('collections.addPlaceSearch')}
|
||||
className={`${INPUT} pl-8`}
|
||||
|
||||
@@ -150,7 +150,7 @@ export default function LabelManager({ isOpen, labels, onCreate, onUpdate, onDel
|
||||
<input
|
||||
value={newName}
|
||||
onChange={e => setNewName(e.target.value)}
|
||||
onKeyDown={e => { if (e.key === 'Enter') add() }}
|
||||
onKeyDown={e => { if (e.key === 'Enter') void add() }}
|
||||
maxLength={60}
|
||||
placeholder={t('collections.labels.namePlaceholder')}
|
||||
className={`${INPUT} flex-1`}
|
||||
|
||||
@@ -219,7 +219,7 @@ export default function ListEditorModal({ target, onClose, onCreated, onRequestD
|
||||
<input
|
||||
value={coverQuery}
|
||||
onChange={e => setCoverQuery(e.target.value)}
|
||||
onKeyDown={e => { if (e.key === 'Enter') { e.preventDefault(); searchCover() } }}
|
||||
onKeyDown={e => { if (e.key === 'Enter') { e.preventDefault(); void searchCover() } }}
|
||||
aria-label={t('dashboard.unsplashSearchPlaceholder')}
|
||||
placeholder={t('dashboard.unsplashSearchPlaceholder')}
|
||||
className={`${INPUT} flex-1`}
|
||||
|
||||
@@ -56,7 +56,7 @@ export default function MSaveToCollectionSheet() {
|
||||
let cancelled = false
|
||||
setLoading(true)
|
||||
setMembership(null)
|
||||
Promise.all([
|
||||
void Promise.all([
|
||||
collectionsApi.list().catch(() => ({ collections: [], incomingInvites: [] })),
|
||||
membershipQuery
|
||||
? collectionsApi.membership(membershipQuery).catch(() => ({ saved: false, lists: [] as CollectionMembership['lists'] }))
|
||||
|
||||
@@ -59,7 +59,7 @@ export default function SaveToCollectionModal(): React.ReactElement | null {
|
||||
let cancelled = false
|
||||
setLoading(true)
|
||||
setMembership(null)
|
||||
Promise.all([collectionsApi.list().catch(() => ({ collections: [], incomingInvites: [] })), membershipQuery ? collectionsApi.membership(membershipQuery).catch(() => ({ saved: false, lists: [] as CollectionMembership['lists'] })) : Promise.resolve({ saved: false, lists: [] as CollectionMembership['lists'] })])
|
||||
void Promise.all([collectionsApi.list().catch(() => ({ collections: [], incomingInvites: [] })), membershipQuery ? collectionsApi.membership(membershipQuery).catch(() => ({ saved: false, lists: [] as CollectionMembership['lists'] })) : Promise.resolve({ saved: false, lists: [] as CollectionMembership['lists'] })])
|
||||
.then(([listRes, m]) => {
|
||||
if (cancelled) return
|
||||
setLists(listRes.collections)
|
||||
|
||||
@@ -21,7 +21,7 @@ export default function CollectionsWidget({ onOpen }: { onOpen: () => void }): R
|
||||
|
||||
useEffect(() => {
|
||||
let cancelled = false
|
||||
;(async () => {
|
||||
;void (async () => {
|
||||
try {
|
||||
const data = await collectionsApi.list()
|
||||
if (!cancelled) setLists(data.collections)
|
||||
|
||||
@@ -36,7 +36,7 @@ export function AssignModal(S: FileManagerState) {
|
||||
const val = e.target.value.trim()
|
||||
const file = files.find(f => f.id === assignFileId)
|
||||
if (file && val !== (file.description || '')) {
|
||||
handleAssign(file.id, { description: val } as any)
|
||||
void handleAssign(file.id, { description: val } as any)
|
||||
}
|
||||
}}
|
||||
onKeyDown={e => { if (e.key === 'Enter') (e.target as HTMLInputElement).blur() }}
|
||||
|
||||
@@ -5,7 +5,7 @@ import { getAuthUrl } from '../../api/authUrl'
|
||||
export function AuthedImg({ src, style }: { src: string; style?: React.CSSProperties }) {
|
||||
const [authSrc, setAuthSrc] = useState('')
|
||||
useEffect(() => {
|
||||
getAuthUrl(src, 'download').then(setAuthSrc)
|
||||
void getAuthUrl(src, 'download').then(setAuthSrc)
|
||||
}, [src])
|
||||
return authSrc ? <img src={authSrc} alt="" style={style} /> : null
|
||||
}
|
||||
|
||||
@@ -168,7 +168,7 @@ function ThumbImg({ file, active, onClick }: { file: TripFile & { url: string };
|
||||
useEffect(() => {
|
||||
if (!visible || fileIsVideo) return
|
||||
let current = true
|
||||
getAuthUrl(file.url, 'download').then(u => { if (current) setSrc(u) })
|
||||
void getAuthUrl(file.url, 'download').then(u => { if (current) setSrc(u) })
|
||||
return () => { current = false }
|
||||
}, [file.url, fileIsVideo, visible])
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ export function useFileManager({ files = [], onUpload, onDelete, onUpdate, place
|
||||
|
||||
// onUpdate doubles as the "files changed" signal towards the parent; the arguments carry no payload.
|
||||
const refreshFiles = useCallback(async () => {
|
||||
if (onUpdate) onUpdate(0, {} as any)
|
||||
if (onUpdate) void onUpdate(0, {} as any)
|
||||
}, [onUpdate])
|
||||
|
||||
const handleStar = async (fileId: number) => {
|
||||
@@ -185,7 +185,7 @@ export function useFileManager({ files = [], onUpload, onDelete, onUpdate, place
|
||||
|
||||
useEffect(() => {
|
||||
if (previewFile) {
|
||||
getAuthUrl(previewFile.url, 'download').then(setPreviewFileUrl)
|
||||
void getAuthUrl(previewFile.url, 'download').then(setPreviewFileUrl)
|
||||
} else {
|
||||
setPreviewFileUrl('')
|
||||
}
|
||||
|
||||
@@ -232,7 +232,7 @@ export function EntryEditor({ entry, journeyId, tripDates, galleryPhotos, trips,
|
||||
// The discovery is not tied to the open tab, so the result is applied even if
|
||||
// the user left the tab meanwhile — dropping it would leave providersLoading
|
||||
// stuck and block every later run of this effect.
|
||||
;(async () => {
|
||||
;void (async () => {
|
||||
try {
|
||||
const addonsData = await addonsApi.enabled()
|
||||
const enabled = (addonsData.addons || []).filter((a: any) => a.type === 'photo_provider' && a.enabled)
|
||||
|
||||
@@ -184,18 +184,18 @@ export function ProviderPicker({
|
||||
// load on mount / filter change
|
||||
useEffect(() => {
|
||||
if (filter === 'day' && initialDate) {
|
||||
searchPhotos(initialDate, initialDate);
|
||||
void searchPhotos(initialDate, initialDate);
|
||||
} else if (filter === 'trip' && tripRange.from && tripRange.to) {
|
||||
searchPhotos(tripRange.from, tripRange.to);
|
||||
void searchPhotos(tripRange.from, tripRange.to);
|
||||
} else if (filter === 'all') {
|
||||
searchPhotos('', '');
|
||||
void searchPhotos('', '');
|
||||
} else if (filter === 'album' && albums.length === 0) {
|
||||
loadAlbums();
|
||||
void loadAlbums();
|
||||
}
|
||||
}, [filter]);
|
||||
|
||||
const handleCustomSearch = () => {
|
||||
if (customFrom && customTo) searchPhotos(customFrom, customTo);
|
||||
if (customFrom && customTo) void searchPhotos(customFrom, customTo);
|
||||
};
|
||||
|
||||
// Sorted here rather than in the two fetches above. contextLocation is live
|
||||
@@ -224,7 +224,7 @@ export function ProviderPicker({
|
||||
|
||||
const loadMorePhotos = () => {
|
||||
if (loadingMore || !canLoadMore) return;
|
||||
searchPhotos(searchFrom, searchTo, searchPage + 1, true);
|
||||
void searchPhotos(searchFrom, searchTo, searchPage + 1, true);
|
||||
};
|
||||
|
||||
const selectionEntry = (asset: PickerAsset | undefined): SelectedAsset => ({
|
||||
@@ -462,7 +462,7 @@ export function ProviderPicker({
|
||||
onClick={() => {
|
||||
setSelectedAlbum(a.id);
|
||||
setSelectedAlbumPassphrase(a.passphrase);
|
||||
loadAlbumPhotos(a);
|
||||
void loadAlbumPhotos(a);
|
||||
}}
|
||||
className={`flex-shrink-0 rounded-lg border px-2.5 py-1 text-[11px] font-medium whitespace-nowrap ${
|
||||
selectedAlbum === a.id
|
||||
|
||||
@@ -308,7 +308,7 @@ export function JourneySettingsDialog({ journey, onClose, onSaved, onOpenInvite,
|
||||
</span>
|
||||
<ToggleSwitch
|
||||
on={!!journey.show_trip_tracks}
|
||||
onToggle={() => { if (!savingTracks) handleTracksToggle() }}
|
||||
onToggle={() => { if (!savingTracks) void handleTracksToggle() }}
|
||||
label={t('journey.settings.showTripTracks')}
|
||||
/>
|
||||
</div>
|
||||
@@ -345,7 +345,7 @@ export function JourneySettingsDialog({ journey, onClose, onSaved, onOpenInvite,
|
||||
<span className="min-w-0 flex-1 text-content" style={fs(13, 'body')}>{label}</span>
|
||||
<ToggleSwitch
|
||||
on={journey[field] !== 0}
|
||||
onToggle={() => { if (savingField === null) handleFieldToggle(field) }}
|
||||
onToggle={() => { if (savingField === null) void handleFieldToggle(field) }}
|
||||
label={label}
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -41,7 +41,7 @@ export default function OfflineBanner(): React.ReactElement | null {
|
||||
setConflictCount(conflicts)
|
||||
}
|
||||
}
|
||||
poll()
|
||||
void poll()
|
||||
const id = setInterval(poll, POLL_MS)
|
||||
return () => { cancelled = true; clearInterval(id) }
|
||||
}, [])
|
||||
|
||||
@@ -78,7 +78,7 @@ export function BagModal(S: PackingState) {
|
||||
{canEdit && (showAddBag ? (
|
||||
<div style={{ display: 'flex', gap: 6, marginTop: 14 }}>
|
||||
<input autoFocus value={newBagName} onChange={e => setNewBagName(e.target.value)}
|
||||
onKeyDown={e => { if (e.key === 'Enter') handleCreateBag(); if (e.key === 'Escape') { setShowAddBag(false); setNewBagName('') } }}
|
||||
onKeyDown={e => { if (e.key === 'Enter') void handleCreateBag(); if (e.key === 'Escape') { setShowAddBag(false); setNewBagName('') } }}
|
||||
placeholder={t('packing.bagName')}
|
||||
style={{ flex: 1, padding: '8px 12px', borderRadius: 10, border: '1px solid var(--border-primary)', fontSize: 'calc(13px * var(--fs-scale-body, 1))', fontFamily: 'inherit', outline: 'none' }} />
|
||||
<button type="button" onClick={handleCreateBag} disabled={!newBagName.trim()}
|
||||
|
||||
@@ -55,7 +55,7 @@ export function BagSidebar(S: PackingState) {
|
||||
<div ref={composerRef} style={{ ...COMPOSER, margin: '10px 10px 0', padding: '4px 4px 4px 10px' }}>
|
||||
<span aria-hidden style={{ width: 10, height: 10, borderRadius: '50%', border: '1.5px dashed var(--text-faint)', flexShrink: 0 }} />
|
||||
<input autoFocus value={newBagName} onChange={e => setNewBagName(e.target.value)}
|
||||
onKeyDown={e => { if (e.key === 'Enter') handleCreateBag(); if (e.key === 'Escape') closeComposer() }}
|
||||
onKeyDown={e => { if (e.key === 'Enter') void handleCreateBag(); if (e.key === 'Escape') closeComposer() }}
|
||||
placeholder={t('packing.bagName')}
|
||||
style={{ flex: 1, minWidth: 0, padding: '5px 0', border: 'none', fontSize: 'calc(12.5px * var(--fs-scale-body, 1))', fontWeight: 500, fontFamily: 'inherit', outline: 'none', color: 'var(--text-primary)', background: 'transparent' }} />
|
||||
<button type="button" onClick={handleCreateBag} disabled={!newBagName.trim()} aria-label={t('common.add')} style={composerConfirm(!!newBagName.trim())}>
|
||||
|
||||
@@ -634,10 +634,10 @@ function usePlaceFormModal(props: PlaceFormModalProps) {
|
||||
} else if (e.key === 'Enter') {
|
||||
e.preventDefault()
|
||||
if (acHighlight >= 0) {
|
||||
handleSelectSuggestion(acSuggestions[acHighlight])
|
||||
void handleSelectSuggestion(acSuggestions[acHighlight])
|
||||
} else {
|
||||
setAcSuggestions([])
|
||||
handleMapsSearch()
|
||||
void handleMapsSearch()
|
||||
}
|
||||
} else if (e.key === 'Escape') {
|
||||
// Spent on the list: the dialog leaves an Escape that was already
|
||||
@@ -648,7 +648,7 @@ function usePlaceFormModal(props: PlaceFormModalProps) {
|
||||
}
|
||||
} else if (e.key === 'Enter') {
|
||||
e.preventDefault()
|
||||
handleMapsSearch()
|
||||
void handleMapsSearch()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1056,7 +1056,7 @@ export default function PlaceFormModal(props: PlaceFormModalProps) {
|
||||
<Tooltip label={t('common.search')}>
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => { setAcSuggestions([]); handleMapsSearch() }}
|
||||
onClick={() => { setAcSuggestions([]); void handleMapsSearch() }}
|
||||
disabled={isSearchingMaps}
|
||||
aria-label={t('common.search')}
|
||||
className={`${SIDE_BUTTON} bg-accent text-accent-text hover:opacity-90`}
|
||||
|
||||
@@ -79,7 +79,7 @@ export function ListImportModal(S: SidebarState) {
|
||||
type="text"
|
||||
value={listImportUrl}
|
||||
onChange={e => setListImportUrl(e.target.value)}
|
||||
onKeyDown={e => { if (e.key === 'Enter' && !listImportLoading) handleListImport() }}
|
||||
onKeyDown={e => { if (e.key === 'Enter' && !listImportLoading) void handleListImport() }}
|
||||
placeholder={google ? 'https://maps.app.goo.gl/...' : 'https://naver.me/...'}
|
||||
autoFocus
|
||||
className={INPUT}
|
||||
|
||||
@@ -332,8 +332,8 @@ export function ReservationModal({ isOpen, onClose, onSave, reservation, days, p
|
||||
}
|
||||
}
|
||||
|
||||
const handleCreateExpense = () => { expenseIntentRef.current = { create: true }; handleSubmit() }
|
||||
const handleEditExpense = (item: BudgetItem) => { expenseIntentRef.current = { editItem: item }; handleSubmit() }
|
||||
const handleCreateExpense = () => { expenseIntentRef.current = { create: true }; void handleSubmit() }
|
||||
const handleEditExpense = (item: BudgetItem) => { expenseIntentRef.current = { editItem: item }; void handleSubmit() }
|
||||
const handleRemoveExpense = async (item: BudgetItem) => {
|
||||
try { await deleteBudgetItem(Number(tripId), item.id) } catch { toast.error(t('common.unknownError')) }
|
||||
}
|
||||
|
||||
@@ -648,8 +648,8 @@ export function TransportModal({ isOpen, onClose, onSave, reservation, days, sel
|
||||
}
|
||||
}
|
||||
|
||||
const handleCreateExpense = () => { expenseIntentRef.current = { create: true }; handleSubmit() }
|
||||
const handleEditExpense = (item: BudgetItem) => { expenseIntentRef.current = { editItem: item }; handleSubmit() }
|
||||
const handleCreateExpense = () => { expenseIntentRef.current = { create: true }; void handleSubmit() }
|
||||
const handleEditExpense = (item: BudgetItem) => { expenseIntentRef.current = { editItem: item }; void handleSubmit() }
|
||||
const handleRemoveExpense = async (item: BudgetItem) => {
|
||||
try { await deleteBudgetItem(Number(tripId), item.id) } catch { toast.error(t('common.unknownError')) }
|
||||
}
|
||||
|
||||
@@ -306,7 +306,7 @@ export default function ApiKeysSection(): React.ReactElement {
|
||||
{t('settings.apiKeys.modal.name')}
|
||||
</label>
|
||||
<input id="api-key-name" type="text" value={newName} onChange={e => setNewName(e.target.value)}
|
||||
onKeyDown={e => { if (e.key === 'Enter') handleCreate() }}
|
||||
onKeyDown={e => { if (e.key === 'Enter') void handleCreate() }}
|
||||
placeholder={t('settings.apiKeys.modal.namePlaceholder')}
|
||||
maxLength={100}
|
||||
className="w-full rounded-lg border px-3 py-2.5 text-body focus:outline-none focus:ring-2 ring-accent border-edge bg-surface-input text-content"
|
||||
@@ -343,7 +343,7 @@ export default function ApiKeysSection(): React.ReactElement {
|
||||
<ConfirmDialog
|
||||
isOpen={deleteId !== null}
|
||||
onClose={() => setDeleteId(null)}
|
||||
onConfirm={() => { if (deleteId !== null) handleDelete(deleteId) }}
|
||||
onConfirm={() => { if (deleteId !== null) void handleDelete(deleteId) }}
|
||||
title={t('settings.apiKeys.deleteTitle')}
|
||||
message={t('settings.apiKeys.deleteMessage')}
|
||||
confirmLabel={t('settings.apiKeys.deleteTitle')}
|
||||
|
||||
@@ -234,7 +234,7 @@ function useIntegrations() {
|
||||
}
|
||||
|
||||
const handleCopy = (text: string, key: string) => {
|
||||
navigator.clipboard.writeText(text).then(() => {
|
||||
void navigator.clipboard.writeText(text).then(() => {
|
||||
setCopiedKey(key)
|
||||
if (copyTimerRef.current) clearTimeout(copyTimerRef.current)
|
||||
copyTimerRef.current = setTimeout(() => setCopiedKey(null), 2000)
|
||||
|
||||
@@ -138,7 +138,7 @@ export default function PasskeysSection({ demoMode }: { demoMode?: boolean }): R
|
||||
type="text"
|
||||
value={renameVal}
|
||||
onChange={e => setRenameVal(e.target.value)}
|
||||
onKeyDown={e => { if (e.key === 'Enter') handleRename(c.id); if (e.key === 'Escape') setRenamingId(null) }}
|
||||
onKeyDown={e => { if (e.key === 'Enter') void handleRename(c.id); if (e.key === 'Escape') setRenamingId(null) }}
|
||||
className="flex-1 px-2 py-1 border border-slate-300 rounded text-sm"
|
||||
/>
|
||||
<button type="button" onClick={() => handleRename(c.id)} className="p-1 text-emerald-600" aria-label={t('common.save')}><Check size={16} /></button>
|
||||
|
||||
@@ -485,7 +485,7 @@ function NewTaskPane({ tripId, categories, members, defaultCategory, onCreated,
|
||||
|
||||
<div style={FORM_BODY}>
|
||||
<input autoFocus value={name} onChange={e => setName(e.target.value)}
|
||||
onKeyDown={e => { if (e.key === 'Enter' && name.trim()) create() }}
|
||||
onKeyDown={e => { if (e.key === 'Enter' && name.trim()) void create() }}
|
||||
style={{ ...taskInputStyle, fontSize: 'calc(15px * var(--fs-scale-subtitle, 1))', fontWeight: 600 }}
|
||||
placeholder={t('todo.namePlaceholder')} />
|
||||
<TodoTaskFields values={fields} onChange={patch => setFields(f => ({ ...f, ...patch }))} categories={categories} members={members} />
|
||||
|
||||
@@ -258,7 +258,7 @@ export default function TripFormModal({ isOpen, onClose, onSave, trip, onCoverUp
|
||||
setPendingUnsplashUrl(null)
|
||||
if (isEditing && trip?.id) {
|
||||
// Existing trip: upload immediately
|
||||
uploadCoverNow(normalized)
|
||||
void uploadCoverNow(normalized)
|
||||
} else {
|
||||
// New trip: stage for upload after creation
|
||||
setPendingCoverFile(normalized)
|
||||
@@ -269,7 +269,7 @@ export default function TripFormModal({ isOpen, onClose, onSave, trip, onCoverUp
|
||||
}
|
||||
|
||||
const handleCoverChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||
handleCoverSelect(e.target.files?.[0])
|
||||
void handleCoverSelect(e.target.files?.[0])
|
||||
e.target.value = ''
|
||||
}
|
||||
|
||||
@@ -361,7 +361,7 @@ export default function TripFormModal({ isOpen, onClose, onSave, trip, onCoverUp
|
||||
if (item.type.startsWith('image/')) {
|
||||
e.preventDefault()
|
||||
const file = item.getAsFile()
|
||||
if (file) handleCoverSelect(file)
|
||||
if (file) void handleCoverSelect(file)
|
||||
return
|
||||
}
|
||||
}
|
||||
@@ -488,7 +488,7 @@ export default function TripFormModal({ isOpen, onClose, onSave, trip, onCoverUp
|
||||
<button type="button" onClick={() => fileRef.current?.click()} disabled={uploadingCover}
|
||||
onDragOver={e => { e.preventDefault(); setCoverDragActive(true) }}
|
||||
onDragLeave={() => setCoverDragActive(false)}
|
||||
onDrop={e => { e.preventDefault(); setCoverDragActive(false); const file = e.dataTransfer.files?.[0]; if (file?.type.startsWith('image/')) handleCoverSelect(file) }}
|
||||
onDrop={e => { e.preventDefault(); setCoverDragActive(false); const file = e.dataTransfer.files?.[0]; if (file?.type.startsWith('image/')) void handleCoverSelect(file) }}
|
||||
className={`w-full h-[130px] px-4 border-2 border-dashed rounded-xl flex items-center justify-center gap-1.5 text-body transition-colors ${
|
||||
coverDragActive
|
||||
? 'border-accent bg-accent-subtle text-content'
|
||||
@@ -502,7 +502,7 @@ export default function TripFormModal({ isOpen, onClose, onSave, trip, onCoverUp
|
||||
type="text"
|
||||
value={coverSearchQuery}
|
||||
onChange={e => setCoverSearchQuery(e.target.value)}
|
||||
onKeyDown={e => { if (e.key === 'Enter') { e.preventDefault(); handleCoverSearch() } }}
|
||||
onKeyDown={e => { if (e.key === 'Enter') { e.preventDefault(); void handleCoverSearch() } }}
|
||||
placeholder={t('dashboard.unsplashSearchPlaceholder')}
|
||||
className={inputCls}
|
||||
/>
|
||||
|
||||
@@ -31,7 +31,7 @@ export default function VacayCalendar() {
|
||||
|
||||
useEffect(() => {
|
||||
let cancelled = false
|
||||
;(async () => {
|
||||
;void (async () => {
|
||||
try {
|
||||
const data = await tripsApi.list()
|
||||
const dates = new Set<string>()
|
||||
|
||||
@@ -73,7 +73,7 @@ export default function VacayPersons() {
|
||||
<div className="vg-card rounded-[22px]" style={{ padding: '14px 18px' }}>
|
||||
<div className="flex items-center justify-between mb-2">
|
||||
<span style={{ fontSize: 11, fontWeight: 600, textTransform: 'uppercase', letterSpacing: '0.14em', color: 'var(--vg-ink3)' }}>{t('vacay.persons')}</span>
|
||||
<button type="button" onClick={() => { setShowInvite(true); loadAvailable() }}
|
||||
<button type="button" onClick={() => { setShowInvite(true); void loadAvailable() }}
|
||||
className="w-7 h-7 rounded-lg flex items-center justify-center transition-colors"
|
||||
style={{ color: 'var(--vg-ink3)' }}>
|
||||
<UserPlus size={15} />
|
||||
|
||||
@@ -64,7 +64,7 @@ export default function VacaySharedCalendars() {
|
||||
<div className="vg-card rounded-[22px]" style={{ padding: '14px 18px' }}>
|
||||
<div className="flex items-center justify-between mb-2">
|
||||
<span style={{ fontSize: 11, fontWeight: 600, textTransform: 'uppercase', letterSpacing: '0.14em', color: 'var(--vg-ink3)' }}>{t('vacay.sharedCalendars')}</span>
|
||||
<button type="button" onClick={() => { setShowShare(true); loadAvailable() }}
|
||||
<button type="button" onClick={() => { setShowShare(true); void loadAvailable() }}
|
||||
className="w-7 h-7 rounded-lg flex items-center justify-center transition-colors"
|
||||
style={{ color: 'var(--vg-ink3)' }}
|
||||
title={t('vacay.shareCalendar')}>
|
||||
|
||||
@@ -118,7 +118,7 @@ function StatCard({ stat: s, isMe, canEdit, selectedYear, isShiftedYear, onSave,
|
||||
setEditing(false)
|
||||
const days = Number.parseInt(String(localDays))
|
||||
if (!Number.isNaN(days) && days >= 0 && days <= 365 && days !== s.vacation_days) {
|
||||
onSave(selectedYear, days, s.user_id)
|
||||
void onSave(selectedYear, days, s.user_id)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ export function SlidingTabs<T extends string>({
|
||||
// Re-measure once web fonts settle — on a reload the first measure runs against
|
||||
// fallback-font metrics, so the (bold) active label reflows and the pill drifts.
|
||||
let cancelled = false
|
||||
document.fonts?.ready?.then(() => {
|
||||
void document.fonts?.ready?.then(() => {
|
||||
if (!cancelled) measure()
|
||||
})
|
||||
|
||||
|
||||
@@ -240,7 +240,7 @@ function useRatesFor(base: string | null): Record<string, number> | null {
|
||||
if (cached) setRates(cached.rates)
|
||||
if (cached && Date.now() - cached.ts < TTL_MS) return
|
||||
let cancelled = false
|
||||
fetchExchangeRates(base).then(r => {
|
||||
void fetchExchangeRates(base).then(r => {
|
||||
if (!cancelled && r) setRates(r)
|
||||
})
|
||||
return () => { cancelled = true }
|
||||
|
||||
+2
-2
@@ -38,10 +38,10 @@ import ErrorBoundary, { RootErrorFallback } from './components/shared/ErrorBound
|
||||
import { installGlobalErrorHandlers } from './utils/globalErrorHandlers'
|
||||
import { schedulePrecacheRepair } from './utils/serviceWorkerShell'
|
||||
|
||||
maybeInstallTouchDragPolyfill()
|
||||
void maybeInstallTouchDragPolyfill()
|
||||
startConnectivityProbe()
|
||||
// Keep offline data (map tiles, file blobs, IndexedDB) exempt from eviction.
|
||||
requestPersistentStorage()
|
||||
void requestPersistentStorage()
|
||||
// Event handlers and async code never reach a boundary; this is where they land.
|
||||
installGlobalErrorHandlers()
|
||||
// A page the precache keeps under a stylesheet's or a script's name would be
|
||||
|
||||
@@ -97,7 +97,7 @@ export default function MAdminAddonManager({ bagTrackingEnabled, onToggleBagTrac
|
||||
const [loading, setLoading] = useState(true)
|
||||
|
||||
useEffect(() => {
|
||||
loadAddons().finally(() => setLoading(false))
|
||||
void loadAddons().finally(() => setLoading(false))
|
||||
}, [])
|
||||
|
||||
const loadAddons = async () => {
|
||||
@@ -430,7 +430,7 @@ function LlmParsingConfig({ addon }: { addon: Addon }) {
|
||||
|
||||
// Load installed models when the local provider is active.
|
||||
useEffect(() => {
|
||||
if (provider === 'local') loadModels()
|
||||
if (provider === 'local') void loadModels()
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [provider])
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ export default function MAdminBackupPanel() {
|
||||
} catch {}
|
||||
}
|
||||
|
||||
useEffect(() => { loadBackups(); loadAutoSettings() }, [])
|
||||
useEffect(() => { void loadBackups(); void loadAutoSettings() }, [])
|
||||
|
||||
const handleCreate = async () => {
|
||||
setIsCreating(true)
|
||||
|
||||
@@ -29,7 +29,7 @@ export default function MAdminCategoryManager() {
|
||||
const toast = useToast()
|
||||
const { t } = useTranslation()
|
||||
|
||||
useEffect(() => { loadCategories() }, [])
|
||||
useEffect(() => { void loadCategories() }, [])
|
||||
|
||||
const loadCategories = async () => {
|
||||
setIsLoading(true)
|
||||
|
||||
@@ -184,7 +184,7 @@ export default function MAdminDefaultUserSettings(): React.ReactElement {
|
||||
setMapboxStyle(nextStyle)
|
||||
patch[styleSettingKey(nextProvider)] = nextStyle
|
||||
}
|
||||
save(patch)
|
||||
void save(patch)
|
||||
}
|
||||
|
||||
// No active value when the setting is unset → segmented shows no pill, matching
|
||||
@@ -391,7 +391,7 @@ export default function MAdminDefaultUserSettings(): React.ReactElement {
|
||||
onBlur={() => {
|
||||
const nextStyle = normalizeStyleForProvider(mapProvider, mapboxStyle)
|
||||
setMapboxStyle(nextStyle)
|
||||
save({ [styleKey]: nextStyle })
|
||||
void save({ [styleKey]: nextStyle })
|
||||
}}
|
||||
placeholder={defaultStyleForProvider(mapProvider)}
|
||||
/>
|
||||
@@ -433,7 +433,7 @@ export default function MAdminDefaultUserSettings(): React.ReactElement {
|
||||
onClose={() => setCurrencyOpen(false)}
|
||||
title={t('settings.currency')}
|
||||
value={defaults.default_currency || ''}
|
||||
onSelect={(value) => { if (value) save({ default_currency: value }) }}
|
||||
onSelect={(value) => { if (value) void save({ default_currency: value }) }}
|
||||
options={currenciesWith(defaults.default_currency).map((c) => ({ value: c, label: SYMBOLS[c] ? `${c} ${SYMBOLS[c]}` : c }))}
|
||||
/>
|
||||
|
||||
@@ -442,7 +442,7 @@ export default function MAdminDefaultUserSettings(): React.ReactElement {
|
||||
onClose={() => setPresetOpen(false)}
|
||||
title={t('settings.mapTemplate')}
|
||||
value={mapTileUrl}
|
||||
onSelect={(value) => { if (value) { setMapTileUrl(value); save({ map_tile_url: value }) } }}
|
||||
onSelect={(value) => { if (value) { setMapTileUrl(value); void save({ map_tile_url: value }) } }}
|
||||
options={MAP_PRESETS.map((p) => ({ value: p.url, label: p.name }))}
|
||||
/>
|
||||
|
||||
@@ -451,7 +451,7 @@ export default function MAdminDefaultUserSettings(): React.ReactElement {
|
||||
onClose={() => setStyleOpen(false)}
|
||||
title={t('admin.defaultSettings.mapboxStyle')}
|
||||
value={mapboxStyle}
|
||||
onSelect={(value) => { if (value) { setMapboxStyle(value); save({ [styleKey]: value }) } }}
|
||||
onSelect={(value) => { if (value) { setMapboxStyle(value); void save({ [styleKey]: value }) } }}
|
||||
options={glStylePresets.map((p) => ({ value: p.url, label: p.name }))}
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -77,7 +77,7 @@ export default function MAdminGitHubPanel({ isPrerelease = false }: { isPrerelea
|
||||
|
||||
useEffect(() => {
|
||||
setLoading(true)
|
||||
loadFrom(1, false).finally(() => setLoading(false))
|
||||
void loadFrom(1, false).finally(() => setLoading(false))
|
||||
}, [])
|
||||
|
||||
const handleLoadMore = async () => {
|
||||
|
||||
@@ -84,7 +84,7 @@ export default function MAdminPackingTemplateManager() {
|
||||
const toast = useToast()
|
||||
const { t } = useTranslation()
|
||||
|
||||
useEffect(() => { loadTemplates() }, [])
|
||||
useEffect(() => { void loadTemplates() }, [])
|
||||
|
||||
const loadTemplates = async () => {
|
||||
setIsLoading(true)
|
||||
@@ -216,7 +216,7 @@ export default function MAdminPackingTemplateManager() {
|
||||
autoFocus
|
||||
value={createName}
|
||||
onChange={e => setCreateName(e.target.value)}
|
||||
onKeyDown={e => { if (e.key === 'Enter') handleCreateTemplate(); if (e.key === 'Escape') setShowCreate(false) }}
|
||||
onKeyDown={e => { if (e.key === 'Enter') void handleCreateTemplate(); if (e.key === 'Escape') setShowCreate(false) }}
|
||||
placeholder={t('admin.packingTemplates.namePlaceholder')}
|
||||
/>
|
||||
</div>
|
||||
@@ -254,7 +254,7 @@ export default function MAdminPackingTemplateManager() {
|
||||
value={editTemplateName}
|
||||
onChange={e => setEditTemplateName(e.target.value)}
|
||||
onBlur={() => handleRenameTemplate(tmpl.id)}
|
||||
onKeyDown={e => { if (e.key === 'Enter') handleRenameTemplate(tmpl.id); if (e.key === 'Escape') setEditingTemplate(null) }}
|
||||
onKeyDown={e => { if (e.key === 'Enter') void handleRenameTemplate(tmpl.id); if (e.key === 'Escape') setEditingTemplate(null) }}
|
||||
/>
|
||||
</div>
|
||||
) : (
|
||||
@@ -292,7 +292,7 @@ export default function MAdminPackingTemplateManager() {
|
||||
value={editCatName}
|
||||
onChange={e => setEditCatName(e.target.value)}
|
||||
onBlur={() => handleRenameCategory(cat.id)}
|
||||
onKeyDown={e => { if (e.key === 'Enter') handleRenameCategory(cat.id); if (e.key === 'Escape') setEditingCatId(null) }}
|
||||
onKeyDown={e => { if (e.key === 'Enter') void handleRenameCategory(cat.id); if (e.key === 'Escape') setEditingCatId(null) }}
|
||||
/>
|
||||
</div>
|
||||
) : (
|
||||
@@ -329,7 +329,7 @@ export default function MAdminPackingTemplateManager() {
|
||||
autoFocus
|
||||
value={editItemName}
|
||||
onChange={e => setEditItemName(e.target.value)}
|
||||
onKeyDown={e => { if (e.key === 'Enter') handleRenameItem(item.id); if (e.key === 'Escape') setEditingItemId(null) }}
|
||||
onKeyDown={e => { if (e.key === 'Enter') void handleRenameItem(item.id); if (e.key === 'Escape') setEditingItemId(null) }}
|
||||
/>
|
||||
</div>
|
||||
<PkIconBtn size={28} variant="accent" ariaLabel={t('common.save')} onClick={() => handleRenameItem(item.id)}><Check size={13} /></PkIconBtn>
|
||||
@@ -361,7 +361,7 @@ export default function MAdminPackingTemplateManager() {
|
||||
ref={addItemRef}
|
||||
value={newItemName}
|
||||
onChange={e => setNewItemName(e.target.value)}
|
||||
onKeyDown={e => { if (e.key === 'Enter' && newItemName.trim()) handleAddItem(cat.id); if (e.key === 'Escape') { setAddingItemToCatId(null); setNewItemName('') } }}
|
||||
onKeyDown={e => { if (e.key === 'Enter' && newItemName.trim()) void handleAddItem(cat.id); if (e.key === 'Escape') { setAddingItemToCatId(null); setNewItemName('') } }}
|
||||
placeholder={t('admin.packingTemplates.itemName')}
|
||||
className={inlineFieldCls}
|
||||
/>
|
||||
@@ -383,7 +383,7 @@ export default function MAdminPackingTemplateManager() {
|
||||
autoFocus
|
||||
value={newCatName}
|
||||
onChange={e => setNewCatName(e.target.value)}
|
||||
onKeyDown={e => { if (e.key === 'Enter') handleAddCategory(); if (e.key === 'Escape') { setAddingCategory(false); setNewCatName('') } }}
|
||||
onKeyDown={e => { if (e.key === 'Enter') void handleAddCategory(); if (e.key === 'Escape') { setAddingCategory(false); setNewCatName('') } }}
|
||||
placeholder={t('admin.packingTemplates.categoryName')}
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -38,7 +38,7 @@ export default function MAdminPermissionsPanel(): React.ReactElement {
|
||||
const [dirty, setDirty] = useState(false)
|
||||
|
||||
useEffect(() => {
|
||||
loadPermissions()
|
||||
void loadPermissions()
|
||||
}, [])
|
||||
|
||||
const loadPermissions = async () => {
|
||||
|
||||
@@ -178,7 +178,7 @@ export default function MAdminSheets({ admin, t }: MAdminSheetsProps) {
|
||||
onClick={() => {
|
||||
const user = editingUser
|
||||
setEditingUser(null)
|
||||
handleDeleteUser(user)
|
||||
void handleDeleteUser(user)
|
||||
}}
|
||||
>
|
||||
<Trash2 size={12} strokeWidth={2.2} />
|
||||
|
||||
@@ -152,8 +152,8 @@ export default function MAtlasBucketSheet({ atlas, open, onClose }: MAtlasBucket
|
||||
}}
|
||||
onKeyDown={(e) => {
|
||||
if (e.key !== 'Enter') return
|
||||
if (bucketForm.name) handleAddBucketItem()
|
||||
else handleBucketPoiSearch()
|
||||
if (bucketForm.name) void handleAddBucketItem()
|
||||
else void handleBucketPoiSearch()
|
||||
}}
|
||||
placeholder={t('atlas.bucketNamePlaceholder')}
|
||||
className={`${inputCls} min-w-0 flex-1`}
|
||||
|
||||
@@ -161,7 +161,7 @@ export default function MCollAddSheet({ open, collectionId, collectionName, list
|
||||
<input
|
||||
value={query}
|
||||
onChange={e => setQuery(e.target.value)}
|
||||
onKeyDown={e => { if (e.key === 'Enter') { e.preventDefault(); search() } }}
|
||||
onKeyDown={e => { if (e.key === 'Enter') { e.preventDefault(); void search() } }}
|
||||
placeholder={t('collections.addPlaceSearch')}
|
||||
className="min-w-0 flex-1 bg-transparent py-2 font-[inherit] text-[0.8125rem] text-m-ink outline-none placeholder:text-m-faint"
|
||||
/>
|
||||
|
||||
@@ -204,7 +204,7 @@ export default function MCollEditSheet({ target, onClose, onCreated, onRequestDe
|
||||
<input
|
||||
value={coverQuery}
|
||||
onChange={e => setCoverQuery(e.target.value)}
|
||||
onKeyDown={e => { if (e.key === 'Enter') { e.preventDefault(); searchCover() } }}
|
||||
onKeyDown={e => { if (e.key === 'Enter') { e.preventDefault(); void searchCover() } }}
|
||||
placeholder={t('dashboard.unsplashSearchPlaceholder')}
|
||||
className="min-w-0 flex-1 rounded-[12px] border border-[color:var(--m-rowbr)] bg-[color:var(--m-sheet)] px-3 py-[10px] font-geist text-[0.71875rem] text-m-ink outline-none placeholder:text-m-faint"
|
||||
/>
|
||||
|
||||
@@ -101,7 +101,7 @@ export default function MCollLabelsSheet({
|
||||
<input
|
||||
value={name}
|
||||
onChange={e => setName(e.target.value)}
|
||||
onKeyDown={e => { if (e.key === 'Enter') submit() }}
|
||||
onKeyDown={e => { if (e.key === 'Enter') void submit() }}
|
||||
placeholder={t('collections.labels.namePlaceholder')}
|
||||
className={INPUT_CLS}
|
||||
/>
|
||||
|
||||
@@ -98,7 +98,7 @@ export default function MCollShareSheet({
|
||||
if (collectionId == null) return
|
||||
const current = member.role ?? 'editor'
|
||||
const next = COLLECTION_ROLES[(COLLECTION_ROLES.indexOf(current) + 1) % COLLECTION_ROLES.length]
|
||||
run(member.user_id, () => setMemberRole(collectionId, member.user_id, next))
|
||||
void run(member.user_id, () => setMemberRole(collectionId, member.user_id, next))
|
||||
}
|
||||
|
||||
const handleInvite = async () => {
|
||||
|
||||
@@ -356,7 +356,7 @@ export default function MNewTripSheet({ open, trip, onClose, onSave, onCoverUpda
|
||||
type="file"
|
||||
accept="image/*"
|
||||
className="hidden"
|
||||
onChange={e => { handleCoverFile(e.target.files?.[0]); e.target.value = '' }}
|
||||
onChange={e => { void handleCoverFile(e.target.files?.[0]); e.target.value = '' }}
|
||||
/>
|
||||
{coverPreview ? (
|
||||
<div className="relative h-[130px] overflow-hidden rounded-[16px]">
|
||||
@@ -398,7 +398,7 @@ export default function MNewTripSheet({ open, trip, onClose, onSave, onCoverUpda
|
||||
<input
|
||||
value={searchQuery}
|
||||
onChange={e => setSearchQuery(e.target.value)}
|
||||
onKeyDown={e => { if (e.key === 'Enter') { e.preventDefault(); handleSearch() } }}
|
||||
onKeyDown={e => { if (e.key === 'Enter') { e.preventDefault(); void handleSearch() } }}
|
||||
placeholder={t('dashboard.unsplashSearchPlaceholder')}
|
||||
className={`${inputCls} pt-0 text-[0.8125rem] font-medium`}
|
||||
/>
|
||||
|
||||
@@ -262,7 +262,7 @@ export default function MJourneyDetail() {
|
||||
|
||||
useEffect(() => {
|
||||
let active = true
|
||||
;(async () => {
|
||||
;void (async () => {
|
||||
try {
|
||||
const addonsData = await addonsApi.enabled()
|
||||
const enabled = (addonsData.addons || []).filter(
|
||||
|
||||
@@ -160,7 +160,7 @@ export default function MJourneyEntrySheet({
|
||||
if (!addonsLoaded) return
|
||||
if (photoProviders.length === 0) { setProviders([]); return }
|
||||
let active = true
|
||||
;(async () => {
|
||||
;void (async () => {
|
||||
const connected: { id: string; name: string }[] = []
|
||||
for (const provider of photoProviders) {
|
||||
try {
|
||||
|
||||
@@ -647,7 +647,7 @@ function MPasskeysCard({ demoMode }: { demoMode?: boolean }): React.ReactElement
|
||||
value={renameVal}
|
||||
onChange={(e) => setRenameVal(e.target.value)}
|
||||
onKeyDown={(e) => {
|
||||
if (e.key === 'Enter') handleRename(c.id)
|
||||
if (e.key === 'Enter') void handleRename(c.id)
|
||||
if (e.key === 'Escape') setRenamingId(null)
|
||||
}}
|
||||
/>
|
||||
|
||||
@@ -164,7 +164,7 @@ export default function MSettingsMcp() {
|
||||
}`
|
||||
|
||||
const handleCopy = (text: string, key: string) => {
|
||||
navigator.clipboard.writeText(text).then(() => {
|
||||
void navigator.clipboard.writeText(text).then(() => {
|
||||
setCopiedKey(key)
|
||||
if (copyTimerRef.current) clearTimeout(copyTimerRef.current)
|
||||
copyTimerRef.current = setTimeout(() => setCopiedKey(null), 2000)
|
||||
|
||||
@@ -117,7 +117,7 @@ function PluginSettingsForm({ id, name, icon }: { id: string; name: string; icon
|
||||
const runAction = (a: PluginAction) => {
|
||||
// Danger actions confirm first (native sheet in place of window.confirm).
|
||||
if (a.danger) { setConfirmAction(a); return }
|
||||
performAction(a)
|
||||
void performAction(a)
|
||||
}
|
||||
|
||||
const save = async () => {
|
||||
@@ -258,7 +258,7 @@ function PluginSettingsForm({ id, name, icon }: { id: string; name: string; icon
|
||||
confirmLabel={confirmAction?.label}
|
||||
cancelLabel={t('common.cancel')}
|
||||
danger
|
||||
onConfirm={() => { const a = confirmAction; setConfirmAction(null); if (a) performAction(a) }}
|
||||
onConfirm={() => { const a = confirmAction; setConfirmAction(null); if (a) void performAction(a) }}
|
||||
/>
|
||||
</>
|
||||
)
|
||||
|
||||
@@ -94,7 +94,7 @@ export default function ImpListStep({ planner, onBack, onDone }: ImpListStepProp
|
||||
onKeyDown={e => {
|
||||
if (e.key === 'Enter') {
|
||||
e.preventDefault()
|
||||
handleImport()
|
||||
void handleImport()
|
||||
}
|
||||
}}
|
||||
placeholder={provider === 'google' ? 'https://maps.app.goo.gl/…' : 'https://naver.me/…'}
|
||||
|
||||
@@ -482,7 +482,7 @@ export default function MPlaceEditSheet({ planner, onOpenExpense }: MPlaceEditSh
|
||||
placeId={sheetPlace?.id}
|
||||
hintKey="places.createExpenseHint"
|
||||
createDisabled={!form.name.trim() || isSaving}
|
||||
onCreate={() => { expenseIntentRef.current = true; handleSubmit() }}
|
||||
onCreate={() => { expenseIntentRef.current = true; void handleSubmit() }}
|
||||
onEdit={item => onOpenExpense({ editItem: item })}
|
||||
/>
|
||||
)}
|
||||
|
||||
@@ -146,12 +146,12 @@ export default function MPlaceSheet({ planner, shell }: MTripSheetsProps) {
|
||||
const removeParticipant = (userId: number) => {
|
||||
let next = allJoined ? members.filter(m => m.id !== userId).map(m => m.id) : participantIds.filter(id => id !== userId)
|
||||
if (next.length === members.length) next = []
|
||||
setParticipants(next)
|
||||
void setParticipants(next)
|
||||
}
|
||||
|
||||
const addParticipant = (userId: number) => {
|
||||
const next = [...participantIds, userId]
|
||||
setParticipants(next.length === members.length ? [] : next)
|
||||
void setParticipants(next.length === members.length ? [] : next)
|
||||
setParticipantPickerOpen(false)
|
||||
}
|
||||
|
||||
|
||||
@@ -144,7 +144,7 @@ export default function MTransportSheet({ planner, shell }: MTripSheetsProps) {
|
||||
}
|
||||
|
||||
const deleteTransport = () => {
|
||||
planner.handleDeleteReservation(res.id)
|
||||
void planner.handleDeleteReservation(res.id)
|
||||
shell.closeSheet()
|
||||
}
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ export default function PlCategoryPicker({ planner, value, onChange }: PlCategor
|
||||
onKeyDown={e => {
|
||||
if (e.key === 'Enter') {
|
||||
e.preventDefault()
|
||||
handleCreate()
|
||||
void handleCreate()
|
||||
}
|
||||
}}
|
||||
placeholder={t('places.categoryNamePlaceholder')}
|
||||
|
||||
@@ -301,7 +301,7 @@ export default function PlPlaceSearch({ planner, locationBias, onPick, onResolvi
|
||||
onKeyDown={e => {
|
||||
if (e.key === 'Enter') {
|
||||
e.preventDefault()
|
||||
handleSearch()
|
||||
void handleSearch()
|
||||
}
|
||||
}}
|
||||
onBlur={() => setTimeout(() => setSuggestions([]), 150)}
|
||||
|
||||
@@ -247,8 +247,8 @@ function BookingCard({ res, planner, canEdit, compact }: {
|
||||
key={f.id}
|
||||
role="button"
|
||||
tabIndex={0}
|
||||
onClick={e => { e.stopPropagation(); openFile(f.url, f.original_name) }}
|
||||
onKeyDown={e => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); e.stopPropagation(); openFile(f.url, f.original_name) } }}
|
||||
onClick={e => { e.stopPropagation(); void openFile(f.url, f.original_name) }}
|
||||
onKeyDown={e => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); e.stopPropagation(); void openFile(f.url, f.original_name) } }}
|
||||
className="flex items-center gap-[6px] rounded-[10px] border border-[color:var(--m-rowbr)] bg-m-card px-[10px] py-[7px]"
|
||||
>
|
||||
<FileText size={12} strokeWidth={2} className="flex-none text-m-muted" />
|
||||
|
||||
@@ -599,7 +599,7 @@ export default function MCostsTab({ planner, shell }: MTabScreenProps) {
|
||||
onConfirm={() => {
|
||||
const item = confirmDelete
|
||||
setConfirmDelete(null)
|
||||
if (item) handleDeleteExpense(item)
|
||||
if (item) void handleDeleteExpense(item)
|
||||
}}
|
||||
/>
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ export default function MFileLightbox({ files, index, onIndexChange, onClose, t
|
||||
let cancelled = false
|
||||
setImgSrc('')
|
||||
if (fileUrl && !isVideo(fileMimeType)) {
|
||||
getAuthUrl(fileUrl, 'download').then(url => { if (!cancelled) setImgSrc(url) })
|
||||
void getAuthUrl(fileUrl, 'download').then(url => { if (!cancelled) setImgSrc(url) })
|
||||
}
|
||||
return () => { cancelled = true }
|
||||
}, [fileUrl, fileMimeType])
|
||||
|
||||
@@ -387,7 +387,7 @@ export default function MPackingListTab({ planner }: { planner: TripPlanner }) {
|
||||
autoFocus
|
||||
value={saveTemplateName}
|
||||
onChange={e => setSaveTemplateName(e.target.value)}
|
||||
onKeyDown={e => { if (e.key === 'Enter') saveAsTemplate() }}
|
||||
onKeyDown={e => { if (e.key === 'Enter') void saveAsTemplate() }}
|
||||
placeholder={t('packing.templateName')}
|
||||
className={`${FIELD_CLS} flex-1`}
|
||||
/>
|
||||
@@ -417,7 +417,7 @@ export default function MPackingListTab({ planner }: { planner: TripPlanner }) {
|
||||
value={newCategoryName}
|
||||
onChange={e => setNewCategoryName(e.target.value)}
|
||||
onKeyDown={e => {
|
||||
if (e.key === 'Enter') addNewCategory()
|
||||
if (e.key === 'Enter') void addNewCategory()
|
||||
if (e.key === 'Escape') { setAddingCategory(false); setNewCategoryName('') }
|
||||
}}
|
||||
placeholder={t('packing.newCategoryPlaceholder')}
|
||||
@@ -538,7 +538,7 @@ export default function MPackingListTab({ planner }: { planner: TripPlanner }) {
|
||||
confirmLabel={t('common.delete')}
|
||||
cancelLabel={t('common.cancel')}
|
||||
danger
|
||||
onConfirm={() => { setConfirmClear(false); clearChecked() }}
|
||||
onConfirm={() => { setConfirmClear(false); void clearChecked() }}
|
||||
/>
|
||||
|
||||
<MConfirmSheet
|
||||
@@ -554,7 +554,7 @@ export default function MPackingListTab({ planner }: { planner: TripPlanner }) {
|
||||
onConfirm={() => {
|
||||
const target = deleteCategoryTarget
|
||||
setDeleteCategoryTarget(null)
|
||||
if (target) deleteCategoryItems(target.items)
|
||||
if (target) void deleteCategoryItems(target.items)
|
||||
}}
|
||||
/>
|
||||
</TabScroller>
|
||||
@@ -996,7 +996,7 @@ function PackingItemRow({ item, planner, currentUserId, editMode, canEdit, bagTr
|
||||
autoFocus
|
||||
value={newBagName}
|
||||
onChange={e => setNewBagName(e.target.value)}
|
||||
onKeyDown={e => { if (e.key === 'Enter') submitNewBag(); if (e.key === 'Escape') { setCreatingBag(false); setNewBagName('') } }}
|
||||
onKeyDown={e => { if (e.key === 'Enter') void submitNewBag(); if (e.key === 'Escape') { setCreatingBag(false); setNewBagName('') } }}
|
||||
placeholder={t('packing.bagName')}
|
||||
className={`${FIELD_CLS} flex-1 py-[6px] text-[0.75rem]`}
|
||||
/>
|
||||
|
||||
@@ -265,8 +265,8 @@ function TransportCard({ res, planner, shell, canEdit, compact }: {
|
||||
key={f.id}
|
||||
role="button"
|
||||
tabIndex={0}
|
||||
onClick={e => { e.stopPropagation(); openFile(f.url, f.original_name) }}
|
||||
onKeyDown={e => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); e.stopPropagation(); openFile(f.url, f.original_name) } }}
|
||||
onClick={e => { e.stopPropagation(); void openFile(f.url, f.original_name) }}
|
||||
onKeyDown={e => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); e.stopPropagation(); void openFile(f.url, f.original_name) } }}
|
||||
className="flex items-center gap-[6px] rounded-[10px] border border-[color:var(--m-rowbr)] bg-m-card px-[10px] py-[7px]"
|
||||
>
|
||||
<FileText size={12} strokeWidth={2} className="flex-none text-m-muted" />
|
||||
|
||||
@@ -64,7 +64,7 @@ export function useMVacay() {
|
||||
// Trip-overlap dots: collect every day of the year covered by an own trip.
|
||||
useEffect(() => {
|
||||
let cancelled = false
|
||||
;(async () => {
|
||||
;void (async () => {
|
||||
try {
|
||||
const data = await tripsApi.list()
|
||||
const dates = new Set<string>()
|
||||
|
||||
@@ -644,7 +644,7 @@ function SidebarContent({ data, stats, regionsVisited, countryRegions, onOpenPla
|
||||
<div ref={bucketSearchRowRef} style={{ display: 'flex', gap: 4 }}>
|
||||
<input type="text" value={bucketForm.name || bucketSearch}
|
||||
onChange={e => { const v = e.target.value; if (bucketForm.name) setBucketForm({ ...bucketForm, name: v }); else setBucketSearch(v) }}
|
||||
onKeyDown={e => { if (e.key === 'Enter' && !bucketForm.name) onSearchBucket(); else if (e.key === 'Enter') onAddBucket(); if (e.key === 'Escape') setShowBucketAdd(false) }}
|
||||
onKeyDown={e => { if (e.key === 'Enter' && !bucketForm.name) void onSearchBucket(); else if (e.key === 'Enter') void onAddBucket(); if (e.key === 'Escape') setShowBucketAdd(false) }}
|
||||
placeholder={t('atlas.bucketNamePlaceholder')}
|
||||
autoFocus
|
||||
className="border border-edge text-content bg-surface-input"
|
||||
|
||||
@@ -210,9 +210,9 @@ export function useAdmin() {
|
||||
const [rotatingJwt, setRotatingJwt] = useState<boolean>(false)
|
||||
|
||||
useEffect(() => {
|
||||
loadData()
|
||||
loadAppConfig()
|
||||
loadApiKeys()
|
||||
void loadData()
|
||||
void loadAppConfig()
|
||||
void loadApiKeys()
|
||||
// Skipped rather than caught when the route is closed to us: the request
|
||||
// still reaches the network, still answers 403, and still prints a red line
|
||||
// in the console of every admin who opens this page. Swallowing the promise
|
||||
@@ -441,7 +441,7 @@ export function useAdmin() {
|
||||
setInviteForm({ max_uses: 1, expires_in_days: 7, trip_id: '' })
|
||||
// Copy link to clipboard
|
||||
const link = `${window.location.origin}/register?invite=${data.invite.token}`
|
||||
navigator.clipboard.writeText(link).then(() => toast.success(t('admin.invite.copied')))
|
||||
void navigator.clipboard.writeText(link).then(() => toast.success(t('admin.invite.copied')))
|
||||
} catch (err: unknown) {
|
||||
toast.error(getApiErrorMessage(err, t('admin.invite.createError')))
|
||||
}
|
||||
@@ -459,7 +459,7 @@ export function useAdmin() {
|
||||
|
||||
const copyInviteLink = (token: string) => {
|
||||
const link = `${window.location.origin}/register?invite=${token}`
|
||||
navigator.clipboard.writeText(link).then(() => toast.success(t('admin.invite.copied')))
|
||||
void navigator.clipboard.writeText(link).then(() => toast.success(t('admin.invite.copied')))
|
||||
}
|
||||
|
||||
const handleEditUser = (user) => {
|
||||
|
||||
@@ -63,7 +63,7 @@ export function useDashboard() {
|
||||
}
|
||||
}, [searchParams])
|
||||
|
||||
useEffect(() => { loadTrips() }, [])
|
||||
useEffect(() => { void loadTrips() }, [])
|
||||
|
||||
// Travel stats + upcoming reservations power the atlas row and the sidebar.
|
||||
// Both are best-effort: a failure just leaves that section empty.
|
||||
@@ -91,7 +91,7 @@ export function useDashboard() {
|
||||
// the error banner (loadUser resets authCheckFailed on success). #1283
|
||||
const retryLoad = () => {
|
||||
loadUser({ silent: true })
|
||||
loadTrips()
|
||||
void loadTrips()
|
||||
}
|
||||
|
||||
const today = localIsoToday()
|
||||
|
||||
@@ -22,7 +22,7 @@ export function useFiles() {
|
||||
const [isLoading, setIsLoading] = useState<boolean>(true)
|
||||
|
||||
useEffect(() => {
|
||||
loadData()
|
||||
void loadData()
|
||||
}, [tripId])
|
||||
|
||||
const loadData = async (): Promise<void> => {
|
||||
|
||||
@@ -42,7 +42,7 @@ export function useJourney() {
|
||||
// The bottom-nav "+" opens the new-journey modal via ?create=1.
|
||||
useEffect(() => {
|
||||
if (searchParams.get('create') === '1') {
|
||||
openCreateModal()
|
||||
void openCreateModal()
|
||||
setSearchParams(p => { p.delete('create'); return p }, { replace: true })
|
||||
}
|
||||
}, [searchParams])
|
||||
|
||||
@@ -48,7 +48,7 @@ export function useOAuthAuthorize() {
|
||||
|
||||
useEffect(() => {
|
||||
if (authLoading) return
|
||||
validateRequest()
|
||||
void validateRequest()
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [authLoading, isAuthenticated])
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ export function useDayAdd(options: DayAddOptions): DayAdd {
|
||||
if (inFlight.current) return
|
||||
inFlight.current = true
|
||||
setBusy(true)
|
||||
add().finally(() => {
|
||||
void add().finally(() => {
|
||||
inFlight.current = false
|
||||
setBusy(false)
|
||||
})
|
||||
|
||||
@@ -2849,7 +2849,7 @@ export function useTripPlanner() {
|
||||
if (!receipt) return
|
||||
void (async () => {
|
||||
const files = inMemory && inMemory.length ? inMemory : await getImportFiles(jobId)
|
||||
deleteImportFiles(jobId)
|
||||
void deleteImportFiles(jobId)
|
||||
setReceiptExpense(receiptToPrefill(receipt, canUploadFiles ? files : []))
|
||||
})()
|
||||
} else if (task && task.items && task.items.length > 0) {
|
||||
@@ -2863,7 +2863,7 @@ export function useTripPlanner() {
|
||||
// Prefer the in-memory files (immediate path); after a reload they live in IndexedDB.
|
||||
void (async () => {
|
||||
const files = inMemory && inMemory.length ? inMemory : await getImportFiles(jobId)
|
||||
deleteImportFiles(jobId)
|
||||
void deleteImportFiles(jobId)
|
||||
startImportReview(items, files, kind)
|
||||
})()
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ export const budgetRepo = {
|
||||
return onlineThenCache(
|
||||
async () => {
|
||||
const result = await budgetApi.list(tripId)
|
||||
upsertBudgetItems(result.items)
|
||||
void upsertBudgetItems(result.items)
|
||||
return result
|
||||
},
|
||||
async () => ({
|
||||
|
||||
@@ -14,7 +14,7 @@ export const dayRepo = {
|
||||
return onlineThenCache(
|
||||
async () => {
|
||||
const result = await daysApi.list(tripId)
|
||||
upsertDays(result.days)
|
||||
void upsertDays(result.days)
|
||||
return result
|
||||
},
|
||||
async () => ({
|
||||
|
||||
@@ -8,7 +8,7 @@ export const fileRepo = {
|
||||
return onlineThenCache(
|
||||
async () => {
|
||||
const result = await filesApi.list(tripId)
|
||||
upsertTripFiles(result.files)
|
||||
void upsertTripFiles(result.files)
|
||||
return result
|
||||
},
|
||||
async () => ({
|
||||
|
||||
@@ -10,7 +10,7 @@ export const packingRepo = {
|
||||
return onlineThenCache(
|
||||
async () => {
|
||||
const result = await packingApi.list(tripId)
|
||||
upsertPackingItems(result.items)
|
||||
void upsertPackingItems(result.items)
|
||||
return result
|
||||
},
|
||||
async () => ({
|
||||
|
||||
@@ -10,7 +10,7 @@ export const placeRepo = {
|
||||
return onlineThenCache(
|
||||
async () => {
|
||||
const result = await placesApi.list(tripId, params)
|
||||
upsertPlaces(result.places)
|
||||
void upsertPlaces(result.places)
|
||||
return result
|
||||
},
|
||||
async () => ({
|
||||
|
||||
@@ -8,7 +8,7 @@ export const reservationRepo = {
|
||||
return onlineThenCache(
|
||||
async () => {
|
||||
const result = await reservationsApi.list(tripId)
|
||||
upsertReservations(result.reservations)
|
||||
void upsertReservations(result.reservations)
|
||||
return result
|
||||
},
|
||||
async () => ({
|
||||
|
||||
@@ -8,7 +8,7 @@ export const todoRepo = {
|
||||
return onlineThenCache(
|
||||
async () => {
|
||||
const result = await todoApi.list(tripId)
|
||||
upsertTodoItems(result.items)
|
||||
void upsertTodoItems(result.items)
|
||||
return result
|
||||
},
|
||||
async () => ({
|
||||
|
||||
@@ -75,7 +75,7 @@ export const tripRepo = {
|
||||
return onlineThenCache(
|
||||
async () => {
|
||||
const result = await tripsApi.get(tripId)
|
||||
upsertTrip(result.trip)
|
||||
void upsertTrip(result.trip)
|
||||
return result
|
||||
},
|
||||
async () => {
|
||||
|
||||
@@ -115,14 +115,14 @@ export function fetchPhoto(
|
||||
callback?.(entry)
|
||||
notify(cacheKey, entry)
|
||||
// Generate base64 thumb in background
|
||||
urlToBase64(photoId).then(thumb => {
|
||||
void urlToBase64(photoId).then(thumb => {
|
||||
if (thumb) { entry.thumbDataUrl = thumb; notifyThumb(cacheKey, thumb) }
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
inFlight.add(cacheKey)
|
||||
acquireRequestSlot().then(() =>
|
||||
void acquireRequestSlot().then(() =>
|
||||
mapsApi.placePhoto(photoId, lat, lng, name)
|
||||
.then(async (data: { photoUrl?: string }) => {
|
||||
const photoUrl = data.photoUrl || null
|
||||
|
||||
@@ -173,7 +173,7 @@ function writeToDexie(
|
||||
payload: Record<string, unknown>,
|
||||
state: TripStoreState,
|
||||
): void {
|
||||
;(async () => {
|
||||
;void (async () => {
|
||||
try {
|
||||
await DEXIE_WRITERS[type as TrekWsTripEventName]?.(payload, state)
|
||||
} catch {
|
||||
|
||||
@@ -265,8 +265,8 @@ export const tripSyncManager = {
|
||||
// Cache global user data (tags + categories) — fire-and-forget, so the
|
||||
// gate has to be re-read when the response lands, not when it was issued:
|
||||
// a logout in between would put these rows in the anonymous database.
|
||||
tagsApi.list().then(d => { if (isAuthed()) upsertTags(d.tags) }).catch(() => {})
|
||||
categoriesApi.list().then(d => { if (isAuthed()) upsertCategories(d.categories) }).catch(() => {})
|
||||
tagsApi.list().then(d => { if (isAuthed()) void upsertTags(d.tags) }).catch(() => {})
|
||||
categoriesApi.list().then(d => { if (isAuthed()) void upsertCategories(d.categories) }).catch(() => {})
|
||||
|
||||
// Cache file blobs + map tiles in background (don't block syncAll)
|
||||
const cacheTiles = getOfflinePrefs().cacheTiles
|
||||
|
||||
@@ -91,7 +91,7 @@ export class TrekPhotoCacheService {
|
||||
|
||||
setInFlight(key: string, promise: Promise<Buffer | null>): void {
|
||||
inFlight.set(key, promise);
|
||||
promise.finally(() => inFlight.delete(key));
|
||||
void promise.finally(() => inFlight.delete(key));
|
||||
}
|
||||
|
||||
async sweepExpired(): Promise<void> {
|
||||
|
||||
Reference in New Issue
Block a user