Skip to content

Commit

Permalink
chore: changes for 1.2.7
Browse files Browse the repository at this point in the history
  • Loading branch information
andrei0x309 committed Apr 3, 2023
1 parent 553c83c commit 277f3a7
Show file tree
Hide file tree
Showing 11 changed files with 175 additions and 114 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## Manifest Version 1.2.7

- improve compatibility with ionic 7

## Manifest Version 1.2.6

- upgrade ionic to v7 and update dependencies
Expand Down
4 changes: 2 additions & 2 deletions src/extension/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"name": "__MSG_appName__",
"description": "__MSG_appDesc__",
"default_locale": "en",
"version": "1.2.6",
"version_name": "1.2.6",
"version": "1.2.7",
"version_name": "1.2.7",
"icons": {
"16": "assets/extension-icon/wallet_16.png",
"32": "assets/extension-icon/wallet_32.png",
Expand Down
1 change: 1 addition & 0 deletions src/views/AssetsTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
cssClass="my-custom-class"
message="Please wait..."
:duration="4000"
:key="`k${loading}`"
@didDismiss="loading = false"
>
</ion-loading>
Expand Down
23 changes: 15 additions & 8 deletions src/views/ContractError.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@
<ion-item> Contract: {{ contract }} </ion-item>
<ion-item>
<ion-label>Error From Contract:</ion-label>
<ion-textarea style="overflow-y: scroll;" :rows="10" :cols="20" :value="error" readonly></ion-textarea>
<ion-textarea
style="overflow-y: scroll"
:rows="10"
:cols="20"
:value="error"
readonly
></ion-textarea>
</ion-item>
<ion-item>
<ion-button @click="onCancel">Exit</ion-button>
Expand All @@ -42,6 +48,7 @@
cssClass="my-custom-class"
message="Please wait..."
:duration="4000"
:key="`k${loading}`"
@didDismiss="loading = false"
>
</ion-loading>
Expand All @@ -65,7 +72,7 @@ import {
IonLoading,
} from "@ionic/vue";
import { useRoute } from "vue-router";
import { getSelectedNetwork, getUrl, hexTostr, } from "@/utils/platform";
import { getSelectedNetwork, getUrl, hexTostr } from "@/utils/platform";
import type { Network } from "@/extension/types";
import { mainNets } from "@/utils/networks";

Expand All @@ -86,17 +93,17 @@ export default defineComponent({
const route = useRoute();
const error = hexTostr((route.params?.param as string) ?? "");
const loading = ref(true);
const contract = (route.params?.contract as string) ?? ""
const contract = (route.params?.contract as string) ?? "";
const selectedNetwork = (ref(null) as unknown) as Ref<Network>;

const onCancel = () => {
window.close();
};

onIonViewWillEnter(async () => {
(window as any)?.resizeTo?.(700, 600)
selectedNetwork.value = await getSelectedNetwork()
loading.value = false
(window as any)?.resizeTo?.(700, 600);
selectedNetwork.value = await getSelectedNetwork();
loading.value = false;
});

return {
Expand All @@ -106,7 +113,7 @@ export default defineComponent({
selectedNetwork,
mainNets,
getUrl,
error
error,
};
},
});
Expand Down
124 changes: 86 additions & 38 deletions src/views/HistoryTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,58 @@
</ion-toolbar>
</ion-header>
<ion-content class="ion-padding">
<ion-item v-if="history.length === 0">
You don't have any transaction history
</ion-item>
<ion-item v-else>
<ion-list>
<ion-item style="margin-bottom: 0.3rem;margin-top: 0.3rem" v-for="item of history" :key="item.txHash">
<ion-list>
<ion-item><b style="margin-right: 0.5rem">Date:</b> {{ new Date(item.date).toDateString() }}</ion-item>
<ion-item button @click="copyAddress(item.txHash, getToastRef())">
<p style="font-size: 0.7rem"><b style="margin-right: 0.5rem"><ion-icon style="margin-right: 0.3rem; display: inline-block;" :icon="copyOutline"></ion-icon>TxHash:</b>{{ item.txHash }}</p>
</ion-item>
<ion-item v-if="item.chainId"><b style="margin-right: 0.5rem">ChainId:</b> {{ item.chainId }}</ion-item>
<ion-item v-if="item.webiste"><b style="margin-right: 0.5rem">Website:</b> {{ item.webiste }}</ion-item>
<ion-item v-if="item.txUrl"><b style="margin-right: 0.5rem">ViewTx:</b> <a href="#" @click="openTab(item.txUrl as string)">LINK</a></ion-item>
</ion-list>
<ion-item v-if="history.length === 0">
You don't have any transaction history
</ion-item>
<ion-item>
<ion-button style="margin-left: 0.5rem" color="warning" @click="onWipeHistory">WIPE HISTORY</ion-button>
<ion-item v-else>
<ion-list>
<ion-item
style="margin-bottom: 0.3rem; margin-top: 0.3rem"
v-for="item of history"
:key="item.txHash"
>
<ion-list>
<ion-item
><b style="margin-right: 0.5rem">Date:</b>
{{ new Date(item.date).toDateString() }}</ion-item
>
<ion-item button @click="copyAddress(item.txHash, getToastRef())">
<p style="font-size: 0.7rem">
<b style="margin-right: 0.5rem"
><ion-icon
style="margin-right: 0.3rem; display: inline-block"
:icon="copyOutline"
></ion-icon
>TxHash:</b
>{{ item.txHash }}
</p>
</ion-item>
<ion-item v-if="item.chainId"
><b style="margin-right: 0.5rem">ChainId:</b> {{ item.chainId }}</ion-item
>
<ion-item v-if="item.webiste"
><b style="margin-right: 0.5rem">Website:</b> {{ item.webiste }}</ion-item
>
<ion-item v-if="item.txUrl"
><b style="margin-right: 0.5rem">ViewTx:</b>
<a href="#" @click="openTab(item.txUrl as string)">LINK</a></ion-item
>
</ion-list>
</ion-item>
<ion-item>
<ion-button style="margin-left: 0.5rem" color="warning" @click="onWipeHistory"
>WIPE HISTORY</ion-button
>
</ion-item>
</ion-list>
</ion-item>
</ion-list>
</ion-item>

<ion-loading
<ion-loading
:is-open="loading"
cssClass="my-custom-class"
message="Please wait..."
:duration="4000"
:key="`k${loading}`"
@didDismiss="loading = false"
>
</ion-loading>
Expand All @@ -42,42 +67,65 @@
message="Copied to clipboard"
:duration="1500"
></ion-toast>

</ion-content>
</ion-page>
</template>

<script lang="ts">
import { defineComponent, Ref, ref } from "vue";
import { IonContent, IonHeader, IonPage, IonTitle, IonToolbar, onIonViewWillEnter, IonItem, IonList, IonToast, IonLoading, IonButton, IonIcon } from "@ionic/vue";
import { getHistory, copyAddress, wipeHistory, openTab } from '@/utils/platform'
import type { HistoryItem } from '@/extension/types'
import {
IonContent,
IonHeader,
IonPage,
IonTitle,
IonToolbar,
onIonViewWillEnter,
IonItem,
IonList,
IonToast,
IonLoading,
IonButton,
IonIcon,
} from "@ionic/vue";
import { getHistory, copyAddress, wipeHistory, openTab } from "@/utils/platform";
import type { HistoryItem } from "@/extension/types";
import { copyOutline } from "ionicons/icons";
export default defineComponent({
components: { IonContent, IonHeader, IonPage, IonTitle, IonToolbar, IonItem, IonList, IonToast, IonLoading, IonButton, IonIcon },
components: {
IonContent,
IonHeader,
IonPage,
IonTitle,
IonToolbar,
IonItem,
IonList,
IonToast,
IonLoading,
IonButton,
IonIcon,
},
setup: () => {
const history = ref([]) as Ref<HistoryItem[]>;
const loading = ref(false)
const loading = ref(false);
const toastState = ref(false);
const getToastRef = () => toastState;
const loadData = async () => {
loading.value = true
history.value = await getHistory()
loading.value = false
}
loading.value = true;
history.value = await getHistory();
loading.value = false;
};
const onWipeHistory = async () => {
await wipeHistory()
await wipeHistory();
loadData();
}
};
onIonViewWillEnter(async () => {
loadData()
})
loadData();
});
return {
history,
loading,
Expand All @@ -86,8 +134,8 @@ export default defineComponent({
toastState,
copyOutline,
onWipeHistory,
openTab
}
}
openTab,
};
},
});
</script>
1 change: 1 addition & 0 deletions src/views/RequestNetwork.vue
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
cssClass="my-custom-class"
message="Please wait..."
:duration="4000"
:key="`k${loading}`"
@didDismiss="loading = false"
/>
</ion-content>
Expand Down
1 change: 1 addition & 0 deletions src/views/SignMessage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
cssClass="my-custom-class"
message="Please wait..."
:duration="4000"
:key="`k${loading}`"
@didDismiss="loading = false"
/>
</ion-content>
Expand Down
1 change: 1 addition & 0 deletions src/views/SignTx.vue
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
cssClass="my-custom-class"
message="Please wait..."
:duration="4000"
:key="`k${loading}`"
@didDismiss="loading = false"
>
</ion-loading>
Expand Down
1 change: 1 addition & 0 deletions src/views/SwitchNetwork.vue
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
cssClass="my-custom-class"
message="Please wait..."
:duration="4000"
:key="`k${loading}`"
@didDismiss="loading = false"
/>
</ion-content>
Expand Down
Loading

0 comments on commit 277f3a7

Please sign in to comment.