Skip to content

Commit

Permalink
fixed: ui and emoji update
Browse files Browse the repository at this point in the history
  • Loading branch information
zzggo committed Dec 6, 2024
1 parent 9dac842 commit 54d53a1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 22 deletions.
32 changes: 12 additions & 20 deletions src/background/controller/wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1614,21 +1614,27 @@ export class WalletController extends BaseController {
} else {
// Transform the address array into blockchain objects
transformedArray = address.map((item, index) => {
const defaultEmoji = emoji[index] || {
name: 'Default',
emoji: '🐾',
bgcolor: '#ffffff',
};

return {
id: 0,
name: emoji[index].name,
name: defaultEmoji.name,
chain_id: network,
icon: emoji[index].emoji,
color: emoji[index].bgcolor,
icon: defaultEmoji.emoji,
color: defaultEmoji.bgcolor,
blockchain: [
{
id: index,
name: emoji[index].name,
name: defaultEmoji.name,
chain_id: network,
address: item.address,
coins: ['flow'],
icon: emoji[index].emoji,
color: emoji[index].bgcolor,
icon: defaultEmoji.emoji,
color: defaultEmoji.bgcolor,
},
],
};
Expand Down Expand Up @@ -4014,20 +4020,6 @@ export class WalletController extends BaseController {
};

getEmoji = async () => {
const currentId = await storage.get('currentId');
// let emojires = await storage.get(`${currentId}emoji`)
// if (!emojires) {
// const index1 = Math.floor(Math.random() * emoji.emojis.length);
// let index2;

// do {
// index2 = Math.floor(Math.random() * emoji.emojis.length);
// } while (index1 === index2);

// emojires = [emoji.emojis[index1], emoji.emojis[index2]];
// storage.set(`${currentId}emoji`, emojires)
// }

return emoji.emojis;
};

Expand Down
2 changes: 1 addition & 1 deletion src/ui/views/Dashboard/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ const Header = ({ loading = false }) => {

const createWalletList = (props) => {
return (
<List component="nav" key={props.id} sx={{ pb: '0', mb: '0' }}>
<List component="nav" key={props.id} sx={{ mb: '0', padding: 0 }}>
<WalletFunction
props_id={props.id}
name={props.name}
Expand Down
1 change: 0 additions & 1 deletion src/ui/views/Setting/Wallet/WalletDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,6 @@ const WalletDetail = () => {
const savedWallet = await storage.get('walletDetail');
const walletDetail = JSON.parse(savedWallet);
if (walletDetail) {
console.log('walletDetail ', walletDetail);
setWallet([walletDetail.wallet]);
const selectingEmoji = {};
selectingEmoji['name'] = walletDetail.wallet.name;
Expand Down

0 comments on commit 54d53a1

Please sign in to comment.