minor fixes
This commit is contained in:
@@ -4,7 +4,7 @@ import { ImageWithFallback } from '@components/imageWithFallback';
|
||||
import { truncate } from '@utils/truncate';
|
||||
|
||||
import Avatar from 'boring-avatars';
|
||||
import { memo, useCallback, useContext, useEffect, useState } from 'react';
|
||||
import { memo, useCallback, useContext, useMemo, useState } from 'react';
|
||||
|
||||
export const UserBase = memo(function UserBase({ pubkey }: { pubkey: string }) {
|
||||
const { db }: any = useContext(DatabaseContext);
|
||||
@@ -20,7 +20,7 @@ export const UserBase = memo(function UserBase({ pubkey }: { pubkey: string }) {
|
||||
[db, pubkey]
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
useMemo(() => {
|
||||
fetch(`https://rbr.bio/${pubkey}/metadata.json`, { redirect: 'follow' })
|
||||
.then((response) => {
|
||||
if (response.ok) {
|
||||
|
||||
@@ -7,7 +7,7 @@ import { DotsHorizontalIcon } from '@radix-ui/react-icons';
|
||||
import Avatar from 'boring-avatars';
|
||||
import dayjs from 'dayjs';
|
||||
import relativeTime from 'dayjs/plugin/relativeTime';
|
||||
import { memo, useCallback, useContext, useEffect, useState } from 'react';
|
||||
import { memo, useCallback, useContext, useMemo, useState } from 'react';
|
||||
|
||||
dayjs.extend(relativeTime);
|
||||
|
||||
@@ -30,7 +30,7 @@ export const UserExtend = memo(function UserExtend({ pubkey, time }: { pubkey: s
|
||||
return result[0];
|
||||
}, [db, pubkey]);
|
||||
|
||||
useEffect(() => {
|
||||
useMemo(() => {
|
||||
getCacheProfile()
|
||||
.then((res) => {
|
||||
if (res !== undefined) {
|
||||
|
||||
@@ -2,7 +2,7 @@ import { DatabaseContext } from '@components/contexts/database';
|
||||
|
||||
import { truncate } from '@utils/truncate';
|
||||
|
||||
import { memo, useCallback, useContext, useEffect, useState } from 'react';
|
||||
import { memo, useCallback, useContext, useMemo, useState } from 'react';
|
||||
|
||||
export const UserMention = memo(function UserMention({ pubkey }: { pubkey: string }) {
|
||||
const { db }: any = useContext(DatabaseContext);
|
||||
@@ -23,7 +23,7 @@ export const UserMention = memo(function UserMention({ pubkey }: { pubkey: strin
|
||||
return result[0];
|
||||
}, [db, pubkey]);
|
||||
|
||||
useEffect(() => {
|
||||
useMemo(() => {
|
||||
getCacheProfile()
|
||||
.then((res) => {
|
||||
if (res !== undefined) {
|
||||
|
||||
@@ -4,7 +4,7 @@ import { ImageWithFallback } from '@components/imageWithFallback';
|
||||
import { truncate } from '@utils/truncate';
|
||||
|
||||
import Avatar from 'boring-avatars';
|
||||
import { memo, useCallback, useContext, useEffect, useState } from 'react';
|
||||
import { memo, useCallback, useContext, useMemo, useState } from 'react';
|
||||
|
||||
export const UserMini = memo(function UserMini({ pubkey }: { pubkey: string }) {
|
||||
const { db }: any = useContext(DatabaseContext);
|
||||
@@ -25,7 +25,7 @@ export const UserMini = memo(function UserMini({ pubkey }: { pubkey: string }) {
|
||||
return result[0];
|
||||
}, [db, pubkey]);
|
||||
|
||||
useEffect(() => {
|
||||
useMemo(() => {
|
||||
getCacheProfile()
|
||||
.then((res) => {
|
||||
if (res !== undefined) {
|
||||
|
||||
Reference in New Issue
Block a user