feat: sync and update with all changes from fork (#720)
* feat: sync and update with all changes from fork * refactor: extract clipboard copy logic into custom hook * fix: correct spelling of DEFAULT_REFRESH_FREQUENCY_MS in Stamps and WalletBalance providers * refactor(ui-tests): replace fixed sleeps with condition-based waits * fix: handle null values for size and granteeCount in infoGroups * fix(lint): add newline at end of file in useClipboardCopy hook * fix(ui-tests): page.goto URL * refactor: update import paths for useClipboardCopy --------- Co-authored-by: Ferenc Sárai <sarai.ferenc@gmail.com>
This commit is contained in:
@@ -1,20 +1,22 @@
|
||||
import { Box, Grid, Typography } from '@material-ui/core'
|
||||
import { Box, Grid, Typography } from '@mui/material'
|
||||
import { useSnackbar } from 'notistack'
|
||||
import { ReactElement, useContext, useEffect, useState } from 'react'
|
||||
import { useNavigate, useParams } from 'react-router'
|
||||
import Bookmark from 'remixicon-react/BookmarkLineIcon'
|
||||
import X from 'remixicon-react/CloseLineIcon'
|
||||
|
||||
import ExpandableListItemActions from '../../components/ExpandableListItemActions'
|
||||
import { HistoryHeader } from '../../components/HistoryHeader'
|
||||
import { SwarmButton } from '../../components/SwarmButton'
|
||||
import { SelectEvent, SwarmSelect } from '../../components/SwarmSelect'
|
||||
import TroubleshootConnectionCard from '../../components/TroubleshootConnectionCard'
|
||||
import { Context as BeeContext } from '../../providers/Bee'
|
||||
import { Identity, Context as IdentityContext } from '../../providers/Feeds'
|
||||
import { Context as IdentityContext, Identity, IdentityType } from '../../providers/Feeds'
|
||||
import { Context as SettingsContext } from '../../providers/Settings'
|
||||
import { Context as StampContext } from '../../providers/Stamps'
|
||||
import { ROUTES } from '../../routes'
|
||||
import { persistIdentity, updateFeed } from '../../utils/identity'
|
||||
|
||||
import { FeedPasswordDialog } from './FeedPasswordDialog'
|
||||
|
||||
export default function UpdateFeed(): ReactElement {
|
||||
@@ -56,7 +58,7 @@ export default function UpdateFeed(): ReactElement {
|
||||
return
|
||||
}
|
||||
|
||||
if (selectedIdentity.type === 'V3') {
|
||||
if (selectedIdentity.type === IdentityType.V3) {
|
||||
setShowPasswordPrompt(true)
|
||||
} else {
|
||||
onFeedUpdate(selectedIdentity)
|
||||
@@ -73,8 +75,15 @@ export default function UpdateFeed(): ReactElement {
|
||||
return
|
||||
}
|
||||
|
||||
if (!hash) {
|
||||
enqueueSnackbar(<span>Hash is invalid</span>, { variant: 'error' })
|
||||
setLoading(false)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
await updateFeed(beeApi, identity, hash!, selectedStamp, password as string) // eslint-disable-line
|
||||
await updateFeed(beeApi, identity, hash, selectedStamp, password as string)
|
||||
persistIdentity(identities, identity)
|
||||
setIdentities([...identities])
|
||||
navigate(ROUTES.ACCOUNT_FEEDS_VIEW.replace(':uuid', identity.uuid))
|
||||
|
||||
Reference in New Issue
Block a user