mirror of
https://github.com/RoboSats/robosats.git
synced 2024-09-11 14:05:51 +03:00
Disable robo-identities
This commit is contained in:
parent
d3acb6bfb8
commit
10a5dee619
@ -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<Props> = ({
|
||||
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) {
|
||||
|
@ -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<void> => {
|
||||
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 => {
|
||||
|
@ -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<any, any>) {
|
||||
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<string, Robot>, shortAlias: string) => {
|
||||
acc[shortAlias] = new Robot(robotAttributes);
|
||||
|
Loading…
Reference in New Issue
Block a user