mirror of
https://github.com/utopia-os/utopia-ui.git
synced 2025-12-13 07:46:10 +00:00
fix all lint errors
This commit is contained in:
parent
8556c07378
commit
6e60d47e86
@ -28,6 +28,7 @@ export const ContextWrapper = ({ children }) => {
|
||||
try {
|
||||
// eslint-disable-next-line react-hooks/rules-of-hooks
|
||||
location = useLocation()
|
||||
// eslint-disable-next-line no-catch-all/no-catch-all
|
||||
} catch (e) {
|
||||
location = null
|
||||
}
|
||||
|
||||
@ -69,6 +69,7 @@ export const AuthProvider = ({ userApi, children }: AuthProviderProps) => {
|
||||
setLoading(false)
|
||||
return me
|
||||
} else return undefined
|
||||
// eslint-disable-next-line no-catch-all/no-catch-all
|
||||
} catch (error) {
|
||||
setLoading(false)
|
||||
return undefined
|
||||
|
||||
@ -63,6 +63,7 @@ export const SearchControl = () => {
|
||||
try {
|
||||
const { data } = await axios.get(`https://photon.komoot.io/api/?q=${value}&limit=5`)
|
||||
setGeoResults(data.features)
|
||||
// eslint-disable-next-line no-catch-all/no-catch-all
|
||||
} catch (error) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(error)
|
||||
|
||||
@ -70,6 +70,7 @@ export function ItemFormPopup(props: ItemFormPopupProps) {
|
||||
try {
|
||||
await props.layer.api?.updateItem!({ ...formItem, id: props.item.id })
|
||||
success = true
|
||||
// eslint-disable-next-line no-catch-all/no-catch-all
|
||||
} catch (error) {
|
||||
toast.error(error.toString())
|
||||
}
|
||||
@ -101,6 +102,7 @@ export function ItemFormPopup(props: ItemFormPopupProps) {
|
||||
name: formItem.name ? formItem.name : user?.first_name,
|
||||
}))
|
||||
success = true
|
||||
// eslint-disable-next-line no-catch-all/no-catch-all
|
||||
} catch (error) {
|
||||
toast.error(error.toString())
|
||||
}
|
||||
|
||||
@ -63,6 +63,7 @@ export const ItemViewPopup = forwardRef((props: ItemViewPopupProps, ref: any) =>
|
||||
props.item.layer?.onlyOnePerOwner &&
|
||||
(await props.item.layer.api?.updateItem!({ id: props.item.id, position: null }))
|
||||
success = true
|
||||
// eslint-disable-next-line no-catch-all/no-catch-all
|
||||
} catch (error) {
|
||||
toast.error(error.toString())
|
||||
}
|
||||
|
||||
@ -89,6 +89,7 @@ function useSelectPositionManager(): {
|
||||
position: null,
|
||||
})
|
||||
success = true
|
||||
// eslint-disable-next-line no-catch-all/no-catch-all
|
||||
} catch (error) {
|
||||
toast.error(error.toString())
|
||||
}
|
||||
@ -113,6 +114,7 @@ function useSelectPositionManager(): {
|
||||
position: updatedItem.position,
|
||||
})
|
||||
success = true
|
||||
// eslint-disable-next-line no-catch-all/no-catch-all
|
||||
} catch (error) {
|
||||
toast.error(error.toString())
|
||||
}
|
||||
@ -134,6 +136,7 @@ function useSelectPositionManager(): {
|
||||
try {
|
||||
await markerClicked.layer?.api?.updateItem!(updatedItem)
|
||||
success = true
|
||||
// eslint-disable-next-line no-catch-all/no-catch-all
|
||||
} catch (error) {
|
||||
toast.error(error.toString())
|
||||
}
|
||||
|
||||
@ -62,6 +62,7 @@ export const submitNewItem = async (
|
||||
await layer?.api?.createItem!({ ...formItem, id: uuid, type, parent: item.id })
|
||||
await linkItem(uuid)
|
||||
success = true
|
||||
// eslint-disable-next-line no-catch-all/no-catch-all
|
||||
} catch (error) {
|
||||
toast.error(error.toString())
|
||||
}
|
||||
@ -83,6 +84,7 @@ export const linkItem = async (id: string, item, updateItem) => {
|
||||
try {
|
||||
await item?.layer?.api?.updateItem!(updatedItem)
|
||||
success = true
|
||||
// eslint-disable-next-line no-catch-all/no-catch-all
|
||||
} catch (error) {
|
||||
toast.error(error.toString())
|
||||
}
|
||||
@ -100,6 +102,7 @@ export const unlinkItem = async (id: string, item, updateItem) => {
|
||||
try {
|
||||
await item?.layer?.api?.updateItem!(updatedItem)
|
||||
success = true
|
||||
// eslint-disable-next-line no-catch-all/no-catch-all
|
||||
} catch (error) {
|
||||
toast.error(error.toString())
|
||||
}
|
||||
@ -123,6 +126,7 @@ export const handleDelete = async (
|
||||
try {
|
||||
await item.layer?.api?.deleteItem!(item.id)
|
||||
success = true
|
||||
// eslint-disable-next-line no-catch-all/no-catch-all
|
||||
} catch (error) {
|
||||
toast.error(error.toString())
|
||||
}
|
||||
|
||||
@ -91,6 +91,7 @@ export const OverlayItemsIndexPage = ({
|
||||
try {
|
||||
await layer?.api?.createItem!({ ...formItem, id: uuid })
|
||||
success = true
|
||||
// eslint-disable-next-line no-catch-all/no-catch-all
|
||||
} catch (error) {
|
||||
toast.error(error.toString())
|
||||
}
|
||||
@ -108,6 +109,7 @@ export const OverlayItemsIndexPage = ({
|
||||
try {
|
||||
await layer?.api?.deleteItem!(item.id)
|
||||
success = true
|
||||
// eslint-disable-next-line no-catch-all/no-catch-all
|
||||
} catch (error) {
|
||||
toast.error(error.toString())
|
||||
}
|
||||
|
||||
@ -34,6 +34,7 @@ export async function reverseGeocode(lat: number, lon: number): Promise<string>
|
||||
// Formatiere die Adresse
|
||||
const formattedAddress = `${street} ${houseNumber}, ${city}`.trim()
|
||||
return formattedAddress || ''
|
||||
// eslint-disable-next-line no-catch-all/no-catch-all
|
||||
} catch (error) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error('Error:', error)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user