Skip to content

Commit

Permalink
Fetch dApp from the proper network
Browse files Browse the repository at this point in the history
  • Loading branch information
bobo-k2 committed Sep 14, 2023
1 parent 248f73e commit e917458
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/components/dapp-staking/dapp/Dapp.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import DappStatistics from 'src/components/dapp-staking/dapp/DappStatistics.vue'
import DappStatsCharts from 'src/components/dapp-staking/dapp/DappStatsCharts.vue';
import ProjectDetails from 'src/components/dapp-staking/dapp/ProjectDetails.vue';
import ProjectOverview from 'src/components/dapp-staking/dapp/ProjectOverview.vue';
import { useDappRedirect, useDispatchGetDapps, useStakingList } from 'src/hooks';
import { useDappRedirect, useDispatchGetDapps, useNetworkInfo, useStakingList } from 'src/hooks';
import { Path } from 'src/router';
import { networkParam } from 'src/router/routes';
import { useStore } from 'src/store';
Expand All @@ -53,6 +53,7 @@ export default defineComponent({
},
setup() {
const route = useRoute();
const { currentNetworkName } = useNetworkInfo();
useDappRedirect();
useDispatchGetDapps();
const store = useStore();
Expand Down Expand Up @@ -93,7 +94,10 @@ export default defineComponent({
try {
store.commit('general/setLoading', true, { root: true });
const service = container.get<IDappStakingService>(Symbols.DappStakingService);
const loadedDapp = await service.getDapp(dappAddress.value, 'astar');
const loadedDapp = await service.getDapp(
dappAddress.value,
currentNetworkName.value.toLowerCase()
);
if (loadedDapp) {
store.commit('dapps/updateDapp', loadedDapp);
}
Expand Down

0 comments on commit e917458

Please sign in to comment.