fix: mark deliberately unawaited promises with void (Sonar S9383)

This commit is contained in:
Maurice
2026-10-01 14:19:52 +02:00
parent f9baf3395e
commit db4337287b
96 changed files with 160 additions and 160 deletions
+2 -2
View File
@@ -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])
+1 -1
View File
@@ -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"
+1 -1
View File
@@ -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>
+1 -1
View File
@@ -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>()
+1 -1
View File
@@ -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')}>
+1 -1
View File
@@ -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)
}
}
+1 -1
View File
@@ -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()
})