diff --git a/bin/template/iota-next-index-browser.js b/bin/template/iota-next-index-browser.js
index fed1726..29188fd 100644
--- a/bin/template/iota-next-index-browser.js
+++ b/bin/template/iota-next-index-browser.js
@@ -3676,16 +3676,16 @@
let unlockConditions = output?.output?.unlockConditions || []
// TIMELOCK_UNLOCK_CONDITION_TYPE
- let timelockUnlockCondition = unlockConditions.find(e => e.type === TIMELOCK_UNLOCK_CONDITION_TYPE)
- if(timelockUnlockCondition && nowTime > timelockUnlockCondition.unixTime) {
+ let timelockUnlockCondition = unlockConditions.find((e) => e.type === TIMELOCK_UNLOCK_CONDITION_TYPE)
+ if (timelockUnlockCondition && nowTime > timelockUnlockCondition.unixTime) {
timelockUnlockCondition = null
}
- // Storage Deposit Return Unlock
- let storageDepositReturnUnlockCondition = unlockConditions.find(e => e.type === STORAGE_DEPOSIT_RETURN_UNLOCK_CONDITION_TYPE)
+ // Storage Deposit Return Unlock
+ let storageDepositReturnUnlockCondition = unlockConditions.find((e) => e.type === STORAGE_DEPOSIT_RETURN_UNLOCK_CONDITION_TYPE)
// Expiration Unlock Condition
- let expirationUnlockCondition = unlockConditions.find(e => e.type === EXPIRATION_UNLOCK_CONDITION_TYPE)
+ let expirationUnlockCondition = unlockConditions.find((e) => e.type === EXPIRATION_UNLOCK_CONDITION_TYPE)
let addressInExpirationUnlockCondition
let unixTimeInExpirationUnlockCondition
@@ -3693,14 +3693,14 @@
addressInExpirationUnlockCondition = hexToBech32(expirationUnlockCondition.returnAddress.pubKeyHash)
unixTimeInExpirationUnlockCondition = expirationUnlockCondition.unixTime
}
-
+
if (addressInExpirationUnlockCondition && shimmerAddressList.includes(addressInExpirationUnlockCondition)) {
- if(unixTimeInExpirationUnlockCondition < nowTime) {
+ if (unixTimeInExpirationUnlockCondition < nowTime) {
expirationUnlockCondition = null
storageDepositReturnUnlockCondition = null
}
}
-
+
const features = output?.output?.features || []
let featuresLock = false
if (features.length > 0) {
diff --git a/package.json b/package.json
index 9970b6a..d5b8281 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "tangle-pay-chrome",
- "version": "1.6.3",
+ "version": "1.6.4",
"private": true,
"homepage": "./",
"dependencies": {
@@ -47,7 +47,7 @@
"react-transition-group": "^4.4.2",
"rimraf": "^5.0.1",
"struct": "^0.0.12",
- "tanglepay": "^2.7.1",
+ "tanglepay": "^2.7.4",
"web-vitals": "^1.0.1",
"web3": "^1.7.3",
"yup": "^0.32.11"
diff --git a/public/js/background.js b/public/js/background.js
index 89ea7a4..d184973 100644
--- a/public/js/background.js
+++ b/public/js/background.js
@@ -1087,12 +1087,18 @@ chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
reqId,
dappOrigin: dappOrigin,
method
- })
+ })
+ if (pendingImRequests[key].isAuthorizing && pendingImRequests[key].lastAuthroizingTimestamp && (Date.now() - pendingImRequests[key].lastAuthroizingTimestamp > 15 * 1000)) {
+ pendingImRequests[key].isAuthorizing = false
+ }
if (!pendingImRequests[key].isAuthorizing) {
pendingImRequests[key].isAuthorizing = true
- setTimeout(() => {
- pendingImRequests[key].isAuthorizing = false
- }, 15 * 1000)
+ pendingImRequests[key].lastAuthroizingTimestamp = Date.now()
+
+ // Sometimes it does not execute.
+ // setTimeout(() => {
+ // pendingImRequests[key].isAuthorizing = false
+ // }, 15 * 1000)
const url = `tanglepay://iota_im_authorize?origin=${origin}&content=${dappOrigin}&expires=${expires}&reqId=${reqId}&isSilent=1`
params.url = chrome.runtime.getURL('index.html') + `?url=${encodeURIComponent(url)}`
}
diff --git a/public/manifest.json b/public/manifest.json
index e56e387..b82b1ce 100644
--- a/public/manifest.json
+++ b/public/manifest.json
@@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "TanglePay IOTA Wallet",
- "version": "1.6.3",
+ "version": "1.6.4",
"description": "TanglePay is your IOTA wallet available on Chrome to explore Defi, NFT and more.",
"icons": {
"16": "images/16.png",
@@ -18,7 +18,13 @@
"service_worker": "./js/background.js"
},
"permissions": ["storage", "unlimitedStorage"],
- "host_permissions": ["https://test.api.iotacat.com/","https://test2.api.iotacat.com/","https://explorer-api.iota.org/", "https://node.iotaichi.com/", "https://api.lb-0.h.chrysalis-devnet.iota.cafe/"],
+ "host_permissions": [
+ "https://test.api.iotacat.com/",
+ "https://test2.api.iotacat.com/",
+ "https://explorer-api.iota.org/",
+ "https://node.iotaichi.com/",
+ "https://api.lb-0.h.chrysalis-devnet.iota.cafe/"
+ ],
"web_accessible_resources": [
{
"resources": ["js/inject.js", "font/OpenSans-Regular.ttf", "font/OpenSans-Semibold.ttf"],
diff --git a/src/common/components/DappDialog.js b/src/common/components/DappDialog.js
index 90cf039..8bc9105 100644
--- a/src/common/components/DappDialog.js
+++ b/src/common/components/DappDialog.js
@@ -38,7 +38,11 @@ export const DappDialog = () => {
const ensureWalletStatus = () => {
checkWalletIsPasswordEnabled(curWallet.id).then((res) => {
setIsWalletPassowrdEnabled(res)
- setPassword(context.state.pin)
+ if (!res) {
+ setPassword(context.state.pin)
+ } else {
+ setPassword('')
+ }
})
}
useEffect(() => {
@@ -236,7 +240,6 @@ export const DappDialog = () => {
break
case 'iota_im_authorize':
{
-
await Bridge.iota_im_authorized(curWallet, password, content, reqId)
}
break
@@ -479,16 +482,16 @@ export const DappDialog = () => {
showValue = value / Math.pow(10, foundryData.decimals || 0)
sendAmount = value
showUnit = unit
- } else if (IotaSDK.isIotaStardust(curNodeId)){
+ } else if (IotaSDK.isIotaStardust(curNodeId)) {
const iotaDecimal = IotaSDK.curNode?.decimal || 6
unit = 'IOTA'
showValue = Base.formatNum(BigNumber(value).div(Math.pow(10, iotaDecimal)).valueOf(), iotaDecimal)
- if(parseFloat(showValue) < Math.pow(10, -iotaDecimal)) {
+ if (parseFloat(showValue) < Math.pow(10, -iotaDecimal)) {
showValue = Math.pow(10, -iotaDecimal)
}
sendAmount = BigNumber(showValue).times(Math.pow(10, iotaDecimal)).valueOf()
showUnit = unit
- }else {
+ } else {
unit = unit || 'SMR'
if (!['SMR', 'Glow', 'IOTA'].includes(unit)) {
unit = 'SMR'
@@ -525,8 +528,8 @@ export const DappDialog = () => {
.replace('#fee#', gasFee)
str = `${origin}
` + str
- const dataFromLink = res.metadata ? {metadata: res.metadata} : null
- const dataPerRequest = await Bridge.sendToContentScriptGetData('data_per_request_prefix_' + reqId) || dataFromLink
+ const dataFromLink = res.metadata ? { metadata: res.metadata } : null
+ const dataPerRequest = (await Bridge.sendToContentScriptGetData('data_per_request_prefix_' + reqId)) || dataFromLink
setDappData({
texts: [{ text: str }],
return_url,
@@ -650,25 +653,24 @@ export const DappDialog = () => {
show()
}
break
- case 'iota_im_authorize':
- {
- let str = I18n.t('apps.ImAuthorize')
- const texts = [
- {
- text: str.replace(/\n/g, '
')
- }
- ]
- setDappData({
- texts,
- return_url,
- type,
- content,
- origin,
- expires,
- reqId
- })
- show()
- }
+ case 'iota_im_authorize': {
+ let str = I18n.t('apps.ImAuthorize')
+ const texts = [
+ {
+ text: str.replace(/\n/g, '
')
+ }
+ ]
+ setDappData({
+ texts,
+ return_url,
+ type,
+ content,
+ origin,
+ expires,
+ reqId
+ })
+ show()
+ }
default:
break
}
@@ -693,7 +695,7 @@ export const DappDialog = () => {
if (canShowDappDialog) {
const params = Base.handlerParams(window.location.search)
const url = params.url
- console.log('deeplinkurl',url)
+ console.log('deeplinkurl', url)
if (checkDeepLink(url)) {
// handle silent case
let res = Base.handlerParams(url)
@@ -706,19 +708,19 @@ export const DappDialog = () => {
let [type, address] = path.split('/')
res = Object.assign(res, { type, address })
}
- console.log('dapp data',res)
+ console.log('dapp data', res)
let { isSilent = '' } = res
if (isSilent) {
const isPasswordEnabled = await checkWalletIsPasswordEnabled(curWallet.id)
if (!isPasswordEnabled) {
console.log('entering silent ')
- const {type, content, reqId} = res
+ const { type, content, reqId } = res
let isSilentProcessed = false
switch (type) {
case 'iota_im_authorize':
await Bridge.iota_im_authorized(curWallet, context.state.pin, content, reqId)
isSilentProcessed = true
- break;
+ break
}
if (isSilentProcessed) {
Bridge.closeWindow()
diff --git a/src/panels/account/into/pin.js b/src/panels/account/into/pin.js
index 66e89c9..3a63170 100644
--- a/src/panels/account/into/pin.js
+++ b/src/panels/account/into/pin.js
@@ -139,7 +139,7 @@ export const AccountIntoPin = () => {
)}