diff --git a/frontend/src/components/RobotAvatar/index.tsx b/frontend/src/components/RobotAvatar/index.tsx index c4992f8d..2ad86b83 100644 --- a/frontend/src/components/RobotAvatar/index.tsx +++ b/frontend/src/components/RobotAvatar/index.tsx @@ -3,7 +3,7 @@ import SmoothImage from 'react-smooth-image'; import { Avatar, Badge, Tooltip } from '@mui/material'; import { SendReceiveIcon } from '../Icons'; import placeholder from './placeholder.json'; -import { robohash } from './RobohashGenerator'; +// import { robohash } from './RobohashGenerator'; import { AppContext, type UseAppStoreType } from '../../contexts/AppContext'; interface Props { @@ -53,22 +53,22 @@ const RobotAvatar: React.FC = ({ const backgroundImage = `url(data:${backgroundData.mime};base64,${backgroundData.data})`; const className = placeholderType === 'loading' ? 'loadingAvatar' : 'generatingAvatar'; - useEffect(() => { - // TODO: HANDLE ANDROID AVATARS TOO (when window.NativeRobosats !== undefined) - if (hashId !== undefined) { - robohash - .generate(hashId, small ? 'small' : 'large') - .then((avatar) => { - setAvatarSrc(avatar); - }) - .catch(() => { - setAvatarSrc(''); - }); - setTimeout(() => { - setActiveBackground(false); - }, backgroundFadeTime); - } - }, [hashId]); + // useEffect(() => { + // // TODO: HANDLE ANDROID AVATARS TOO (when window.NativeRobosats !== undefined) + // if (hashId !== undefined) { + // robohash + // .generate(hashId, small ? 'small' : 'large') + // .then((avatar) => { + // setAvatarSrc(avatar); + // }) + // .catch(() => { + // setAvatarSrc(''); + // }); + // setTimeout(() => { + // setActiveBackground(false); + // }, backgroundFadeTime); + // } + // }, [hashId]); useEffect(() => { if (shortAlias !== undefined) { diff --git a/frontend/src/models/Coordinator.model.ts b/frontend/src/models/Coordinator.model.ts index e8d8bcf0..09e74a30 100644 --- a/frontend/src/models/Coordinator.model.ts +++ b/frontend/src/models/Coordinator.model.ts @@ -10,7 +10,7 @@ import { apiClient } from '../services/api'; import { validateTokenEntropy } from '../utils'; import { compareUpdateLimit } from './Limit.model'; import { defaultOrder } from './Order.model'; -import { robohash } from '../components/RobotAvatar/RobohashGenerator'; +// import { robohash } from '../components/RobotAvatar/RobohashGenerator'; export interface Contact { nostr?: string | undefined; @@ -174,9 +174,9 @@ export class Coordinator { }; generateAllMakerAvatars = async (data: [PublicOrder]): Promise => { - for (const order of data) { - void robohash.generate(order.maker_hash_id, 'small'); - } + // for (const order of data) { + // void robohash.generate(order.maker_hash_id, 'small'); + // } }; loadBook = (onDataLoad: () => void = () => {}): void => { diff --git a/frontend/src/models/Slot.model.ts b/frontend/src/models/Slot.model.ts index 864820ed..b043dd7b 100644 --- a/frontend/src/models/Slot.model.ts +++ b/frontend/src/models/Slot.model.ts @@ -1,17 +1,17 @@ import { sha256 } from 'js-sha256'; import { Robot, type Order } from '.'; -import { robohash } from '../components/RobotAvatar/RobohashGenerator'; -import { generate_roboname } from 'robo-identities-wasm'; +// import { robohash } from '../components/RobotAvatar/RobohashGenerator'; +// import { generate_roboname } from 'robo-identities-wasm'; class Slot { constructor(token: string, shortAliases: string[], robotAttributes: Record) { this.token = token; this.hashId = sha256(sha256(this.token)); - this.nickname = generate_roboname(this.hashId); + this.nickname = 'No Nick Display (WIP)'; // trigger RoboHash avatar generation in webworker and store in RoboHash class cache. - void robohash.generate(this.hashId, 'small'); - void robohash.generate(this.hashId, 'large'); + // void robohash.generate(this.hashId, 'small'); + // void robohash.generate(this.hashId, 'large'); this.robots = shortAliases.reduce((acc: Record, shortAlias: string) => { acc[shortAlias] = new Robot(robotAttributes);