File tree 1 file changed +18
-2
lines changed
1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -45,7 +45,9 @@ const selectedChain = ref(chains.value[0]);
45
45
const isGettingAvatar = ref (false );
46
46
47
47
onMounted (() => {
48
- if (accountChain .value ) {
48
+ if (route .query ? .network ) {
49
+ selectChainByName (route .query ? .network );
50
+ } else if (accountChain .value ) {
49
51
selectedChain .value = accountChain .value ;
50
52
}
51
53
@@ -61,16 +63,30 @@ watch(accountChain, () => {
61
63
});
62
64
63
65
watch (selectedChain, () => {
66
+ router .push ({
67
+ params: { walletAddress: walletAddress .value },
68
+ query: { network: selectedChain .value .name .toLowerCase () }
69
+ });
70
+
64
71
updateAvatarInfo ();
65
72
});
66
73
67
74
const isSearchValid = computed (() => {
68
75
return walletAddress .value && isAddress (walletAddress .value ) && walletAddress .value !== fetchedWalletAddress .value && ! isGettingAvatar .value ;
69
76
});
70
77
78
+ function selectChainByName (name ) {
79
+ for (const chain of chains .value ) {
80
+ if (chain .name .toLowerCase () === name .toLowerCase ()) {
81
+ selectedChain .value = chain;
82
+ }
83
+ }
84
+ }
85
+
71
86
function search () {
72
87
router .push ({
73
- params: { walletAddress: walletAddress .value }
88
+ params: { walletAddress: walletAddress .value },
89
+ query: { network: selectedChain .value .name .toLowerCase () }
74
90
});
75
91
76
92
updateAvatarInfo ();
You can’t perform that action at this time.
0 commit comments