Skip to content

Commit

Permalink
fix: refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
impelcrypto committed Feb 19, 2024
1 parent 434f851 commit 62f2105
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions src/hooks/bridge/useL1History.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { useI18n } from 'vue-i18n';
export const useL1History = () => {
const { t } = useI18n();
const store = useStore();
const isGelatoApiConnected = ref<boolean>(true);
const isGelatoApiConnected = ref<boolean>(false);

const l1Network = computed<string>(() => {
const networkIdxStore = String(localStorage.getItem(LOCAL_STORAGE.NETWORK_IDX));
Expand Down Expand Up @@ -74,6 +74,7 @@ export const useL1History = () => {
};

const fetchUserHistory = async (): Promise<void> => {
if (!currentAccount.value) return;
try {
isLoadingHistories.value = true;
const data = await fetchAccountHistory(currentAccount.value);
Expand Down Expand Up @@ -130,17 +131,15 @@ export const useL1History = () => {
histories.value = formattedResult.sort((a, b) => Number(b.timestamp) - Number(a.timestamp));
} catch (error) {
// Memo: disable sending bridge transactions from UI
if (isGelatoApiConnected.value) {
store.dispatch(
'general/showAlertMsg',
{
msg: t('bridge.gelatoApiError'),
alertType: 'error',
},
{ root: true }
);
isGelatoApiConnected.value = false;
}
store.dispatch(
'general/showAlertMsg',
{
msg: t('bridge.gelatoApiError'),
alertType: 'error',
},
{ root: true }
);
isGelatoApiConnected.value = false;
console.error(error);
isFetchAutomatically.value = false;
} finally {
Expand Down

0 comments on commit 62f2105

Please sign in to comment.