Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed: ui and emoji update #257

Merged
merged 1 commit into from
Dec 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading