Skip to content

Commit

Permalink
remove 'cached' from varname
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon-Laux committed Oct 13, 2023
1 parent 7844599 commit c348fca
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/renderer/components/dialogs/ViewProfile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export function ViewProfileInner({
null
)
const [selfChatAvatar, setSelfChatAvatar] = useState<string | null>(null)
const [cachedVerifier, setCachedVerifier] = useState<null | {
const [verifier, setVerifier] = useState<null | {
label: string
action?: () => void
}>(null)
Expand Down Expand Up @@ -176,25 +176,25 @@ export function ViewProfileInner({
useEffect(() => {
;(async () => {
if (contact.verifierId === null) {
setCachedVerifier({ label: tx('verified') })
setVerifier({ label: tx('verified') })
} else if (contact.verifierId === C.DC_CONTACT_ID_SELF) {
setCachedVerifier({ label: tx('verified_by_you') })
setVerifier({ label: tx('verified_by_you') })
} else {
setCachedVerifier(null) // make sure it rather shows nothing than wrong values
setVerifier(null) // make sure it rather shows nothing than wrong values
const verifierContactId = contact.verifierId
try {
const { address } = await BackendRemote.rpc.getContact(
accountId,
verifierContactId
)
setCachedVerifier({
setVerifier({
label: tx('verified_by', address),
action: () =>
openViewProfileDialog(screenContext, verifierContactId),
})
} catch (error) {
log.error('failed to load verifier contact', error)
setCachedVerifier({
setVerifier({
label:
'verified by: failed to load verifier contact, please report this issue',
action: () =>
Expand Down Expand Up @@ -250,13 +250,13 @@ export function ViewProfileInner({
</div>
{!isSelfChat && (
<div className='contact-attributes'>
{contact.isVerified && cachedVerifier && (
{contact.isVerified && verifier && (
<div
className={cachedVerifier.action && 'clickable'}
onClick={cachedVerifier.action}
className={verifier.action && 'clickable'}
onClick={verifier.action}
>
<InlineVerifiedIcon />
{cachedVerifier.label}
{verifier.label}
</div>
)}
{contact.lastSeen !== 0 && (
Expand Down

0 comments on commit c348fca

Please sign in to comment.