Compare commits

..

No commits in common. "a4d99f04fde6b9cb4fff6b5fdcd20feab9f6da68" and "553c83c0cd9416336115a1abd60ef77f2cca22db" have entirely different histories.

12 changed files with 115 additions and 176 deletions

View File

@ -1,9 +1,5 @@
# Changelog
## Manifest Version 1.2.7
- improve compatibility with ionic 7
## Manifest Version 1.2.6
- upgrade ionic to v7 and update dependencies

View File

@ -1,6 +1,6 @@
{
"name": "clear-wallet",
"version": "1.2.7",
"version": "1.2.6",
"private": true,
"scripts": {
"dev": "vite",

View File

@ -3,8 +3,8 @@
"name": "__MSG_appName__",
"description": "__MSG_appDesc__",
"default_locale": "en",
"version": "1.2.7",
"version_name": "1.2.7",
"version": "1.2.6",
"version_name": "1.2.6",
"icons": {
"16": "assets/extension-icon/wallet_16.png",
"32": "assets/extension-icon/wallet_32.png",

View File

@ -11,7 +11,6 @@
cssClass="my-custom-class"
message="Please wait..."
:duration="4000"
:key="`k${loading}`"
@didDismiss="loading = false"
>
</ion-loading>

View File

@ -31,13 +31,7 @@
<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>
@ -48,7 +42,6 @@
cssClass="my-custom-class"
message="Please wait..."
:duration="4000"
:key="`k${loading}`"
@didDismiss="loading = false"
>
</ion-loading>
@ -72,7 +65,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";
@ -93,7 +86,7 @@ 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 = () => {
@ -101,9 +94,9 @@ export default defineComponent({
};
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 {
@ -113,7 +106,7 @@ export default defineComponent({
selectedNetwork,
mainNets,
getUrl,
error,
error
};
},
});

View File

@ -11,43 +11,19 @@
</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-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><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>
<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-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-button style="margin-left: 0.5rem" color="warning" @click="onWipeHistory">WIPE HISTORY</ion-button>
</ion-item>
</ion-list>
</ion-item>
@ -57,7 +33,6 @@
cssClass="my-custom-class"
message="Please wait..."
:duration="4000"
:key="`k${loading}`"
@didDismiss="loading = false"
>
</ion-loading>
@ -67,65 +42,42 @@
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,
@ -134,8 +86,8 @@ export default defineComponent({
toastState,
copyOutline,
onWipeHistory,
openTab,
};
},
openTab
}
}
});
</script>

View File

@ -80,7 +80,6 @@
cssClass="my-custom-class"
message="Please wait..."
:duration="4000"
:key="`k${loading}`"
@didDismiss="loading = false"
/>
</ion-content>

View File

@ -30,7 +30,6 @@
cssClass="my-custom-class"
message="Please wait..."
:duration="4000"
:key="`k${loading}`"
@didDismiss="loading = false"
/>
</ion-content>

View File

@ -99,7 +99,6 @@
cssClass="my-custom-class"
message="Please wait..."
:duration="4000"
:key="`k${loading}`"
@didDismiss="loading = false"
>
</ion-loading>

View File

@ -93,7 +93,6 @@
cssClass="my-custom-class"
message="Please wait..."
:duration="4000"
:key="`k${loading}`"
@didDismiss="loading = false"
/>
</ion-content>

View File

@ -49,7 +49,6 @@
cssClass="my-custom-class"
message="Please wait..."
:duration="4000"
:key="`k${loading}`"
@didDismiss="loading = false"
/>
</ion-content>
@ -72,17 +71,21 @@ import {
IonList,
IonButtons,
modalController,
IonLoading,
IonLoading
} from "@ionic/vue";
import { getAccounts, replaceAccounts, saveSelectedAccount } from "@/utils/platform";
import { decrypt, getCryptoParams } from "@/utils/webCrypto";
import {
getAccounts,
replaceAccounts,
saveSelectedAccount
} from "@/utils/platform";
import { decrypt, getCryptoParams } from "@/utils/webCrypto"
export default defineComponent({
props: {
unlockType: {
type: String,
default: "message",
},
default: 'message'
}
},
components: {
IonContent,
@ -97,41 +100,42 @@ export default defineComponent({
IonAlert,
IonList,
IonButtons,
IonLoading,
IonLoading
},
setup: () => {
const mpPass = ref("");
const mpPass = ref('');
const loading = ref(false);
const alertOpen = ref(false);
const alertMsg = ref("");
const alertMsg = ref('');
const close = () => {
return modalController?.dismiss(null, "cancel");
};
return modalController?.dismiss(null, 'cancel');
}
const unlock = async () => {
try {
loading.value = true;
let accounts = await getAccounts();
const cryptoParams = await getCryptoParams(mpPass.value);
const accProm = accounts.map(async (a) => {
loading.value = true
let accounts = await getAccounts()
const cryptoParams = await getCryptoParams(mpPass.value)
const accProm = accounts.map(async a => {
if(a.encPk) {
a.pk = await decrypt(a.encPk, cryptoParams);
a.pk = await decrypt(a.encPk, cryptoParams)
}
return a;
});
accounts = await Promise.all(accProm);
await replaceAccounts(accounts);
await saveSelectedAccount(accounts[0]);
loading.value = false;
return modalController?.dismiss(mpPass.value, "confirm");
return a
})
accounts = await Promise.all(accProm)
await replaceAccounts(accounts)
await saveSelectedAccount(accounts[0])
loading.value = false
return modalController?.dismiss(mpPass.value, 'confirm');
} catch {
loading.value = false;
alertMsg.value = "Decryption failed, password is not correct, try again.";
alertOpen.value = true;
return;
loading.value = false
alertMsg.value = 'Decryption failed, password is not correct, try again.';
alertOpen.value = true
return
}
};
}
return {
loading,

View File

@ -29,7 +29,6 @@
cssClass="my-custom-class"
message="Please wait..."
:duration="4000"
:key="`k${loading}`"
@didDismiss="loading = false"
>
</ion-loading>