fix errors

This commit is contained in:
Ulf Gebhardt 2024-11-09 00:40:54 +01:00
parent 97c3ef867e
commit 782b0fc700
Signed by: ulfgebhardt
GPG Key ID: DA6B843E748679C9
4 changed files with 12 additions and 4 deletions

View File

@ -63,7 +63,9 @@ export function ProfileView({ attestationApi }: { attestationApi?: ItemsApi<any>
console.log(value)
setAttestations(value)
return null
})
// eslint-disable-next-line promise/prefer-await-to-callbacks
.catch((error) => {
console.error('Error fetching items:', error)
})

View File

@ -16,7 +16,9 @@ const SocialShareBar = ({
.writeText(url)
.then(() => {
toast.success('link copied to clipboard')
return null
})
// eslint-disable-next-line promise/prefer-await-to-callbacks
.catch((error: never) => {
toast.error('Fehler beim Kopieren des Links: ', error)
})

View File

@ -1,5 +1,4 @@
/* eslint-disable @typescript-eslint/no-unsafe-argument */
/* eslint-disable @typescript-eslint/no-floating-promises */
/* eslint-disable @typescript-eslint/restrict-template-expressions */
import { useEffect, useState } from 'react'
import { useNavigate } from 'react-router-dom'
@ -43,6 +42,9 @@ export function UserSettings() {
},
})
.then(() => navigate('/'))
.catch((e) => {
throw e
})
}
return (

View File

@ -9,6 +9,8 @@
/* eslint-disable @typescript-eslint/no-unsafe-call */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
import { setTimeout } from 'timers/promises'
import { toast } from 'react-toastify'
import { Item } from '#src/types'
@ -16,8 +18,6 @@ import { encodeTag } from '#utils/FormatTags'
import { hashTagRegex } from '#utils/HashTagRegex'
import { randomColor } from '#utils/RandomColor'
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms))
export const submitNewItem = async (
evt: any,
type: string,
@ -224,7 +224,7 @@ export const onUpdateItem = async (
})
// take care that addTag request comes before item request
await sleep(200)
await setTimeout(200)
if (!item.new) {
item?.layer?.api?.updateItem &&
@ -243,6 +243,7 @@ export const onUpdateItem = async (
.then(() => {
setLoading(false)
navigate(`/item/${item.id}${params && '?' + params}`)
return null
})
} else {
item.new = false
@ -272,6 +273,7 @@ export const onUpdateItem = async (
.then(() => {
setLoading(false)
navigate(`/${params && '?' + params}`)
return null
})
}
}