Skip to content

Commit

Permalink
Merge release-hotfix to main (#1360)
Browse files Browse the repository at this point in the history
* disable celer bridge (#1353)

* disable cbridge

* fix statement shorter

* disable celer bridge icon too (#1354)

* Fix usePrice hooks (#1355)

* fix usePrice issue

* refactor, just using immediate is enough

* only enable immediate for h160 wallet (#1356)

* Fetch account identity fix (#1359)

---------

Co-authored-by: Taegeon Alan Go <[email protected]>
  • Loading branch information
bobo-k2 and gtg7784 authored Jul 19, 2024
1 parent 06aa139 commit 2f81ce9
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/components/assets/Erc20Currency.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
</router-link>

<div v-if="token.isWrappedToken && !token.isXC20">
<a :href="token.bridgeUrl" target="_blank" rel="noopener noreferrer">
<a :href="token.bridgeUrl ?? undefined" target="_blank" rel="noopener noreferrer">
<button class="btn btn--icon">
<astar-icon-bridge class="icon--bridge" />
</button>
Expand Down
11 changes: 10 additions & 1 deletion src/components/assets/EvmCbridgeToken.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,23 @@
</q-tooltip>
</router-link>

<a :href="cbridgeAppLink" target="_blank" rel="noopener noreferrer">
<!-- <a :href="cbridgeAppLink" target="_blank" rel="noopener noreferrer">
<button class="btn btn--icon">
<astar-icon-bridge class="icon--bridge" />
</button>
<span class="text--expand-menu">{{ $t('assets.bridge') }}</span>
<q-tooltip>
<span class="text--tooltip">{{ $t('assets.bridge') }}</span>
</q-tooltip>
</a> -->
<a>
<button class="btn btn--icon" disabled>
<astar-icon-bridge class="icon--bridge" />
</button>
<span class="text--expand-menu">{{ $t('assets.bridge') }}</span>
<q-tooltip>
<span class="text--tooltip">{{ $t('assets.bridge') }}</span>
</q-tooltip>
</a>

<a :href="explorerLink" target="_blank" rel="noopener noreferrer">
Expand Down
11 changes: 10 additions & 1 deletion src/components/assets/EvmNativeToken.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
</router-link>

<!-- Only SDN is able to bridge via cBridge at this moment -->
<a
<!-- <a
v-if="nativeTokenSymbol === 'SDN'"
:href="cbridgeAppLink"
target="_blank"
Expand All @@ -77,6 +77,15 @@
<q-tooltip>
<span class="text--tooltip">{{ $t('assets.bridge') }}</span>
</q-tooltip>
</a> -->
<a v-if="nativeTokenSymbol === 'SDN'">
<button class="btn btn--icon" disabled>
<astar-icon-bridge />
</button>
<span class="text--mobile-menu">{{ $t('assets.bridge') }}</span>
<q-tooltip>
<span class="text--tooltip">{{ $t('assets.bridge') }}</span>
</q-tooltip>
</a>

<a v-if="isZkyoto" :href="faucetSethLink" target="_blank" rel="noopener noreferrer">
Expand Down
13 changes: 10 additions & 3 deletions src/components/bridge/BridgeSelection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,14 @@
</button>
</div>
<div class="column--selection">
<button>
<a
<button :disabled="!isEnableCelerBridge">
<!-- <a
:href="cbridgeAppLink"
target="_blank"
rel="noopener noreferrer"
class="button--bridge"
>
> -->
<a target="_blank" rel="noopener noreferrer" class="button--bridge">
<div class="row--logo-bg">
<div class="img--logo-bg">
<img
Expand Down Expand Up @@ -186,6 +187,9 @@
</div>
</a>
</button>
<p v-if="!isEnableCelerBridge" class="text--bridge-details">
{{ $t('bridge.celerBridge.warning') }}
</p>
</div>
</div>
</div>
Expand Down Expand Up @@ -241,6 +245,8 @@ export default defineComponent({
return isH160.value && (isAstar.value || isAstarZkEvm.value);
});
const isEnableCelerBridge = computed<boolean>(() => false);
return {
currentAccount,
cbridgeAppLink,
Expand All @@ -256,6 +262,7 @@ export default defineComponent({
isZkyoto,
isEnableLzBridge,
isBridgeMaintenanceMode,
isEnableCelerBridge,
};
},
});
Expand Down
3 changes: 2 additions & 1 deletion src/hooks/usePrice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export function usePrice() {
const chainInfo = store.getters['general/chainInfo'];
return chainInfo ? chainInfo.tokenSymbol : '';
});
const isH160 = computed<boolean>(() => store.getters['general/isH160Formatted']);

const { isMainnet, isAstarZkEvm } = useNetworkInfo();
const { currentAccount } = useAccount();
Expand All @@ -31,7 +32,7 @@ export function usePrice() {
console.error(error.message);
}
},
{ immediate: false }
{ immediate: isH160.value }
);

return {
Expand Down
1 change: 1 addition & 0 deletions src/i18n/en-US/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1097,6 +1097,7 @@ export default {
title: 'Celer Bridge',
tag: 'ERC20',
text: '3rd Party Bridge. Transfer assets between Ethereum or L2s and {cbridgeNetworkName} EVM.',
warning: 'Celer Team announced to not access to cbridge, please do not use it.',
},
layerSwap: {
title: 'Layerswap',
Expand Down
8 changes: 4 additions & 4 deletions src/v2/repositories/implementations/IdentityRepository.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Data, Option, u128 } from '@polkadot/types';
import { Data, Option, Tuple, u128 } from '@polkadot/types';
import { PalletIdentityIdentityInfo, PalletIdentityRegistration } from 'src/v2/models';
import { IdentityInfoAdditional } from '@polkadot/types/interfaces';
import { inject, injectable } from 'inversify';
Expand Down Expand Up @@ -35,14 +35,14 @@ export class IdentityRepository implements IIdentityRepository {
if (!api.query.identity) {
return undefined;
}

const result = await api.query.identity.identityOf<Option<PalletIdentityRegistration>>(address);
const result = await api.query.identity.identityOf<Option<Tuple>>(address);

if (result.isNone) {
return undefined;
}

const identity = result.unwrapOrDefault();
const unwrappedResult = result.unwrapOrDefault();
const identity = <PalletIdentityRegistration>unwrappedResult[0];
const data = new IdentityData(u8aToString(identity.info.display.asRaw), []);
identity.info.additional.forEach((x) => {
// Seems dirty. The problem here is that some raw data is treated as ASCII and some as bytes
Expand Down

0 comments on commit 2f81ce9

Please sign in to comment.