mirror of
https://github.com/utopia-os/utopia-ui.git
synced 2025-12-13 07:46:10 +00:00
fix errors
This commit is contained in:
parent
97c3ef867e
commit
782b0fc700
@ -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)
|
||||
})
|
||||
|
||||
@ -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)
|
||||
})
|
||||
|
||||
@ -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 (
|
||||
|
||||
@ -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
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user