fixed issues in export user data and cash functions
This commit is contained in:
parent
66f0069acc
commit
cfa900cb5c
@ -12007,24 +12007,37 @@
|
|||||||
localbitcoinplusplus.actions = {
|
localbitcoinplusplus.actions = {
|
||||||
parse_flo_comments: async function(callback) {
|
parse_flo_comments: async function(callback) {
|
||||||
|
|
||||||
|
// text = `masterFLOPubKey=03EA5E2CAB18DA585400D6EC569438D415FAF200528E05D0E2B9BEAA2B5C3DCA90
|
||||||
|
// #!#tradableAsset1=BTC,FLO,BTC_TEST,FLO_TEST#!#tradableAsset2=INR,USD,
|
||||||
|
// #!#validTradingAmount=10,50,100,#!#btcTradeMargin=5000
|
||||||
|
// #!#MaxBackups=1
|
||||||
|
// #!#miners_fee={"btc":0.0003, "flo":0.0003}
|
||||||
|
// #!#supernodesPubKeys=0315C3A20FE7096CC2E0F81A80D5F1A687B8F9EFA65242A0B0881E1BA3EE7D7D53,
|
||||||
|
// 03F7493F11B8E44B9798CD434D20FBE7FA34B9779D144984889D11A17C56A18742,039B4AA00DBFC0A6631DE6DA83526611A0E6B857D3579DF840BBDEAE8B6898E3B6,
|
||||||
|
// 03C8E3836C9A77E2AF03D4265D034BA85732738919708EAF6A16382195AE796EDF,0349B08AA1ABDCFFB6D78CD7C949665AD2FF065EA02B3C6C47A5E9592C9A1C6BCB,
|
||||||
|
// 026FCC6CFF6EB3A39E54BEB6E13FC2F02C3A93F4767AA80E49E7E876443F95AE5F,
|
||||||
|
// #!#externalFiles={"d3js":"58f54395efa8346e8e94d12609770f66b916897e7f4e05f6c98780cffa5c70a3"}
|
||||||
|
// #!#cashiers={"032871A74D2DDA9D0DE7135F58B5BD2D7F679D2CCA20EA7909466D1A6912DF4022":"johnDoe@upi",
|
||||||
|
// "03DB4A12EB543B293DDBB0CE314C46C36D6761294AFBB7264A6D78F710FFD97CF0":"janeDoe@upi"}
|
||||||
|
// #!#ShamirsMaxShares=8#!#supernodeSeeds={"ranchimall1":{"ip":"127.0.0.1:9111","kbucketId":"oZxHcbSf1JC8t5GjutopWYXs7C6Fe9p7ps"},
|
||||||
|
// "ranchimall2":{"ip":"127.0.0.1:9112","kbucketId":"oTWjPupy3Z7uMdPcu5uXd521HBkcsLuSuM"},
|
||||||
|
// "ranchimall3":{"ip":"127.0.0.1:9113","kbucketId":"odYA6KagmbokSh9GY7yAfeTUZRtZLwecY1"},
|
||||||
|
// "ranchimall4":{"ip":"127.0.0.1:9114","kbucketId":"oJosrve9dBv2Hj2bfncxv2oEpTysg3Wejv"},
|
||||||
|
// "ranchimall5":{"ip":"127.0.0.1:9115","kbucketId":"oMhv5sAzqg77sYHxmUGZWKRrVo4P4JQduS"},
|
||||||
|
// "ranchimall6":{"ip":"127.0.0.1:9116","kbucketId":"oV1wCeWca3VawbBTfUGKA7Vd368PATnKAx"}}`;
|
||||||
|
|
||||||
|
|
||||||
text = `masterFLOPubKey=03EA5E2CAB18DA585400D6EC569438D415FAF200528E05D0E2B9BEAA2B5C3DCA90
|
text = `masterFLOPubKey=03EA5E2CAB18DA585400D6EC569438D415FAF200528E05D0E2B9BEAA2B5C3DCA90
|
||||||
#!#tradableAsset1=BTC,FLO,BTC_TEST,FLO_TEST#!#tradableAsset2=INR,USD,
|
#!#tradableAsset1=BTC,FLO,BTC_TEST,FLO_TEST#!#tradableAsset2=INR,USD,
|
||||||
#!#validTradingAmount=10,50,100,#!#btcTradeMargin=5000
|
#!#validTradingAmount=10,50,100,#!#btcTradeMargin=5000
|
||||||
#!#MaxBackups=1
|
#!#MaxBackups=1
|
||||||
#!#miners_fee={"btc":0.0003, "flo":0.0003}
|
#!#miners_fee={"btc":0.0003, "flo":0.0003}
|
||||||
#!#supernodesPubKeys=0315C3A20FE7096CC2E0F81A80D5F1A687B8F9EFA65242A0B0881E1BA3EE7D7D53,
|
#!#supernodesPubKeys=026FCC6CFF6EB3A39E54BEB6E13FC2F02C3A93F4767AA80E49E7E876443F95AE5F,
|
||||||
03F7493F11B8E44B9798CD434D20FBE7FA34B9779D144984889D11A17C56A18742,039B4AA00DBFC0A6631DE6DA83526611A0E6B857D3579DF840BBDEAE8B6898E3B6,
|
#!#cashiers={"032871A74D2DDA9D0DE7135F58B5BD2D7F679D2CCA20EA7909466D1A6912DF4022":"johnDoe@upi",
|
||||||
03C8E3836C9A77E2AF03D4265D034BA85732738919708EAF6A16382195AE796EDF,0349B08AA1ABDCFFB6D78CD7C949665AD2FF065EA02B3C6C47A5E9592C9A1C6BCB,
|
"03DB4A12EB543B293DDBB0CE314C46C36D6761294AFBB7264A6D78F710FFD97CF0":"janeDoe@upi"}
|
||||||
026FCC6CFF6EB3A39E54BEB6E13FC2F02C3A93F4767AA80E49E7E876443F95AE5F,
|
#!#ShamirsMaxShares=8#!#supernodeSeeds={
|
||||||
#!#externalFiles={"d3js":"58f54395efa8346e8e94d12609770f66b916897e7f4e05f6c98780cffa5c70a3"}
|
"ranchimall6":{"ip":"127.0.0.1:9116","kbucketId":"oV1wCeWca3VawbBTfUGKA7Vd368PATnKAx"}
|
||||||
#!#cashiers={"032871A74D2DDA9D0DE7135F58B5BD2D7F679D2CCA20EA7909466D1A6912DF4022":"johnDoe@upi",
|
}`;
|
||||||
"03DB4A12EB543B293DDBB0CE314C46C36D6761294AFBB7264A6D78F710FFD97CF0":"janeDoe@upi"}
|
|
||||||
#!#ShamirsMaxShares=8#!#supernodeSeeds={"ranchimall1":{"ip":"127.0.0.1:9111","kbucketId":"oZxHcbSf1JC8t5GjutopWYXs7C6Fe9p7ps"},
|
|
||||||
"ranchimall2":{"ip":"127.0.0.1:9112","kbucketId":"oTWjPupy3Z7uMdPcu5uXd521HBkcsLuSuM"},
|
|
||||||
"ranchimall3":{"ip":"127.0.0.1:9113","kbucketId":"odYA6KagmbokSh9GY7yAfeTUZRtZLwecY1"},
|
|
||||||
"ranchimall4":{"ip":"127.0.0.1:9114","kbucketId":"oJosrve9dBv2Hj2bfncxv2oEpTysg3Wejv"},
|
|
||||||
"ranchimall5":{"ip":"127.0.0.1:9115","kbucketId":"oMhv5sAzqg77sYHxmUGZWKRrVo4P4JQduS"},
|
|
||||||
"ranchimall6":{"ip":"127.0.0.1:9116","kbucketId":"oV1wCeWca3VawbBTfUGKA7Vd368PATnKAx"}}`;
|
|
||||||
return callback(text);
|
return callback(text);
|
||||||
|
|
||||||
if(ENVR==='LIVE') {
|
if(ENVR==='LIVE') {
|
||||||
@ -12698,10 +12711,7 @@
|
|||||||
},
|
},
|
||||||
getSupernodeSeed: function() {
|
getSupernodeSeed: function() {
|
||||||
return new Promise(async (resolve, reject) => {
|
return new Promise(async (resolve, reject) => {
|
||||||
let nearestSupernodeAddresslist = await readAllDB(
|
await removeAllinDB("supernodesList");
|
||||||
"supernodesList"
|
|
||||||
);
|
|
||||||
if (nearestSupernodeAddresslist.length < 1) {
|
|
||||||
const supernodeSeeds =
|
const supernodeSeeds =
|
||||||
localbitcoinplusplus.master_configurations.supernodeSeeds;
|
localbitcoinplusplus.master_configurations.supernodeSeeds;
|
||||||
if (typeof supernodeSeeds !== "object")
|
if (typeof supernodeSeeds !== "object")
|
||||||
@ -12713,7 +12723,7 @@
|
|||||||
throw new Error(e);
|
throw new Error(e);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
|
||||||
resolve(nearestSupernodeAddresslist);
|
resolve(nearestSupernodeAddresslist);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -13897,7 +13907,26 @@
|
|||||||
const confirmTx = confirm(token_transfer_statement);
|
const confirmTx = confirm(token_transfer_statement);
|
||||||
if(!confirmTx) return;
|
if(!confirmTx) return;
|
||||||
|
|
||||||
const websocket_conn = localbitcoinplusplus.supernode_conns[requesting_supernode];
|
// Get the closest Supernode alive for this user
|
||||||
|
|
||||||
|
let closestSuList = await localbitcoinplusplus.kademlia
|
||||||
|
.determineClosestSupernode(websocket_name,
|
||||||
|
localbitcoinplusplus.master_configurations.supernodesPubKeys.length);
|
||||||
|
let closest_live_su = '';
|
||||||
|
for(su_node in closestSuList) {
|
||||||
|
let su = closestSuList[su_node].data.id;
|
||||||
|
if(typeof localbitcoinplusplus.supernode_conns[su]=="object"
|
||||||
|
&& localbitcoinplusplus.supernode_conns[su] !== null
|
||||||
|
&& localbitcoinplusplus.supernode_conns[su].readyState===WebSocket.OPEN) {
|
||||||
|
closest_live_su = su;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(closest_live_su=='') closest_live_su = requesting_supernode;
|
||||||
|
|
||||||
|
//const websocket_conn = localbitcoinplusplus.supernode_conns[requesting_supernode];
|
||||||
|
const websocket_conn = localbitcoinplusplus.supernode_conns[closest_live_su];
|
||||||
if(typeof websocket_conn!=="object") return;
|
if(typeof websocket_conn!=="object") return;
|
||||||
|
|
||||||
let flo_txid = '';
|
let flo_txid = '';
|
||||||
@ -13906,7 +13935,7 @@
|
|||||||
localbitcoinplusplus.BASE_BLOCKCHAIN,
|
localbitcoinplusplus.BASE_BLOCKCHAIN,
|
||||||
localbitcoinplusplus.wallets.my_local_flo_address,
|
localbitcoinplusplus.wallets.my_local_flo_address,
|
||||||
localbitcoinplusplus.wallets.MY_SUPERNODE_PRIVATE_KEY,
|
localbitcoinplusplus.wallets.MY_SUPERNODE_PRIVATE_KEY,
|
||||||
requesting_supernode,
|
closest_live_su,
|
||||||
tx_amount,
|
tx_amount,
|
||||||
localbitcoinplusplus.wallets.my_local_flo_address,
|
localbitcoinplusplus.wallets.my_local_flo_address,
|
||||||
token_transfer_statement
|
token_transfer_statement
|
||||||
@ -13924,7 +13953,7 @@
|
|||||||
localbitcoinplusplus.wallets.my_local_flo_address,
|
localbitcoinplusplus.wallets.my_local_flo_address,
|
||||||
cashier_pubKey:
|
cashier_pubKey:
|
||||||
localbitcoinplusplus.wallets.my_local_flo_public_key,
|
localbitcoinplusplus.wallets.my_local_flo_public_key,
|
||||||
receiver_flo_address: requesting_supernode,
|
receiver_flo_address: closest_live_su,
|
||||||
flo_txid: flo_txid,
|
flo_txid: flo_txid,
|
||||||
deposit_id: deposit_id,
|
deposit_id: deposit_id,
|
||||||
parent_supernode: websocket_name,
|
parent_supernode: websocket_name,
|
||||||
@ -13941,7 +13970,6 @@
|
|||||||
.flo_api_testnet}/api/v1.0/getTransactionDetails/${flo_txid}`;
|
.flo_api_testnet}/api/v1.0/getTransactionDetails/${flo_txid}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(this);
|
|
||||||
let n=1;
|
let n=1;
|
||||||
(async function validateTxidInBlockchain() {
|
(async function validateTxidInBlockchain() {
|
||||||
// Validate Flo txid
|
// Validate Flo txid
|
||||||
@ -14004,7 +14032,24 @@
|
|||||||
const upi_txid = prompt("Enter Transferred Cash UPI Txid: ");
|
const upi_txid = prompt("Enter Transferred Cash UPI Txid: ");
|
||||||
if (upi_txid.length < 1) return;
|
if (upi_txid.length < 1) return;
|
||||||
|
|
||||||
const websocket_conn = localbitcoinplusplus.supernode_conns[requesting_supernode];
|
// Get the closest Supernode alive for this user
|
||||||
|
let closestSuList = await localbitcoinplusplus.kademlia
|
||||||
|
.determineClosestSupernode(websocket_name,
|
||||||
|
localbitcoinplusplus.master_configurations.supernodesPubKeys.length);
|
||||||
|
let closest_live_su = '';
|
||||||
|
for(su_node in closestSuList) {
|
||||||
|
let su = closestSuList[su_node].data.id;
|
||||||
|
if(typeof localbitcoinplusplus.supernode_conns[su]=="object"
|
||||||
|
&& localbitcoinplusplus.supernode_conns[su] !== null
|
||||||
|
&& localbitcoinplusplus.supernode_conns[su].readyState===WebSocket.OPEN) {
|
||||||
|
closest_live_su = su;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(closest_live_su=='') closest_live_su = requesting_supernode;
|
||||||
|
|
||||||
|
const websocket_conn = localbitcoinplusplus.supernode_conns[closestSuList];
|
||||||
if(typeof websocket_conn!=="object") return;
|
if(typeof websocket_conn!=="object") return;
|
||||||
|
|
||||||
RM_RPC.send_rpc
|
RM_RPC.send_rpc
|
||||||
@ -14013,7 +14058,7 @@
|
|||||||
localbitcoinplusplus.wallets.my_local_flo_address,
|
localbitcoinplusplus.wallets.my_local_flo_address,
|
||||||
cashier_pubKey:
|
cashier_pubKey:
|
||||||
localbitcoinplusplus.wallets.my_local_flo_public_key,
|
localbitcoinplusplus.wallets.my_local_flo_public_key,
|
||||||
receiver_flo_address: requesting_supernode,
|
receiver_flo_address: closestSuList,
|
||||||
withdraw_id: withdraw_id,
|
withdraw_id: withdraw_id,
|
||||||
upi_txid: upi_txid,
|
upi_txid: upi_txid,
|
||||||
parent_supernode: websocket_name,
|
parent_supernode: websocket_name,
|
||||||
|
|||||||
44
index.html
44
index.html
@ -12210,14 +12210,13 @@
|
|||||||
#!#validTradingAmount=10,50,100,#!#btcTradeMargin=5000
|
#!#validTradingAmount=10,50,100,#!#btcTradeMargin=5000
|
||||||
#!#MaxBackups=1
|
#!#MaxBackups=1
|
||||||
#!#miners_fee={"btc":0.0003, "flo":0.0003}
|
#!#miners_fee={"btc":0.0003, "flo":0.0003}
|
||||||
#!#supernodesPubKeys=0315C3A20FE7096CC2E0F81A80D5F1A687B8F9EFA65242A0B0881E1BA3EE7D7D53,
|
#!#supernodesPubKeys=026FCC6CFF6EB3A39E54BEB6E13FC2F02C3A93F4767AA80E49E7E876443F95AE5F,
|
||||||
03F7493F11B8E44B9798CD434D20FBE7FA34B9779D144984889D11A17C56A18742,039B4AA00DBFC0A6631DE6DA83526611A0E6B857D3579DF840BBDEAE8B6898E3B6,
|
0315C3A20FE7096CC2E0F81A80D5F1A687B8F9EFA65242A0B0881E1BA3EE7D7D53,
|
||||||
03C8E3836C9A77E2AF03D4265D034BA85732738919708EAF6A16382195AE796EDF,0349B08AA1ABDCFFB6D78CD7C949665AD2FF065EA02B3C6C47A5E9592C9A1C6BCB,
|
|
||||||
026FCC6CFF6EB3A39E54BEB6E13FC2F02C3A93F4767AA80E49E7E876443F95AE5F,
|
|
||||||
#!#cashiers={"032871A74D2DDA9D0DE7135F58B5BD2D7F679D2CCA20EA7909466D1A6912DF4022":"johnDoe@upi",
|
#!#cashiers={"032871A74D2DDA9D0DE7135F58B5BD2D7F679D2CCA20EA7909466D1A6912DF4022":"johnDoe@upi",
|
||||||
"03DB4A12EB543B293DDBB0CE314C46C36D6761294AFBB7264A6D78F710FFD97CF0":"janeDoe@upi"}
|
"03DB4A12EB543B293DDBB0CE314C46C36D6761294AFBB7264A6D78F710FFD97CF0":"janeDoe@upi"}
|
||||||
#!#ShamirsMaxShares=8#!#supernodeSeeds={
|
#!#ShamirsMaxShares=8#!#supernodeSeeds={
|
||||||
"ranchimall4":{"ip":"127.0.0.1:9114","kbucketId":"oJosrve9dBv2Hj2bfncxv2oEpTysg3Wejv"}
|
"ranchimall1":{"ip":"127.0.0.1:9111","kbucketId":"oZxHcbSf1JC8t5GjutopWYXs7C6Fe9p7ps"},
|
||||||
|
"ranchimall6":{"ip":"127.0.0.1:9116","kbucketId":"oV1wCeWca3VawbBTfUGKA7Vd368PATnKAx"}
|
||||||
}`;
|
}`;
|
||||||
return callback(text);
|
return callback(text);
|
||||||
|
|
||||||
@ -12740,7 +12739,7 @@
|
|||||||
"system_btc_reserves_private_keys"
|
"system_btc_reserves_private_keys"
|
||||||
];
|
];
|
||||||
|
|
||||||
let db_list = Object.values(localbitcoinplusplus.newBackupDatabase.db).map(m=>m);
|
let db_list = Object.values(localbitcoinplusplus.newBackupDatabase.db).map(m=>m.db);
|
||||||
db_list.push(db);
|
db_list.push(db);
|
||||||
|
|
||||||
// First create a db backup and save it
|
// First create a db backup and save it
|
||||||
@ -12853,7 +12852,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Delete this user's data from this server
|
// Delete this user's data from this server
|
||||||
localbitcoinplusplus.actions.delete_db_data_for_single_user(myFloId, tableArray);
|
localbitcoinplusplus.actions.delete_db_data_for_single_user(allUsersData[f].trader_flo_address, tableArray);
|
||||||
|
|
||||||
// Ask backups to delete this user data
|
// Ask backups to delete this user data
|
||||||
const msg_obj = {};
|
const msg_obj = {};
|
||||||
@ -14653,6 +14652,7 @@
|
|||||||
|
|
||||||
if(sn===msg_obj.data.subject_flo_id || sn===usrAddr) {
|
if(sn===msg_obj.data.subject_flo_id || sn===usrAddr) {
|
||||||
suList = await getPrevSupernode(sn);
|
suList = await getPrevSupernode(sn);
|
||||||
|
if(suList==null) return false;
|
||||||
sn = suList.trader_flo_address;
|
sn = suList.trader_flo_address;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -21496,9 +21496,8 @@
|
|||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
if (
|
if (
|
||||||
wsUri[0].trader_flo_address !== idbData.myLocalFLOAddress ||
|
|
||||||
getClosestSuList.length <
|
getClosestSuList.length <
|
||||||
localbitcoinplusplus.master_configurations.MaxBackups
|
localbitcoinplusplus.master_configurations.supernodesPubKeys
|
||||||
) {
|
) {
|
||||||
showMessage(
|
showMessage(
|
||||||
`INFO: Invalid connection. Refreshing the closest supernode list in DB.`
|
`INFO: Invalid connection. Refreshing the closest supernode list in DB.`
|
||||||
@ -21599,23 +21598,17 @@
|
|||||||
await reactor.dispatchEvent("backup_supernode_up", evt.srcElement.url);
|
await reactor.dispatchEvent("backup_supernode_up", evt.srcElement.url);
|
||||||
await reactor.dispatchEvent("remove_extra_backup_connections");
|
await reactor.dispatchEvent("remove_extra_backup_connections");
|
||||||
|
|
||||||
debounce(async function() {
|
limit_function_calls(async function() {
|
||||||
await reactor.dispatchEvent("sync_primary_and_backup_db");
|
await reactor.dispatchEvent("sync_primary_and_backup_db");
|
||||||
// Send refresh status request to supernodes
|
|
||||||
//reactor.dispatchEvent("send_refresh_all_supernodes_status_request");
|
|
||||||
// Refresh Supernodes live status
|
|
||||||
await localbitcoinplusplus.actions.refresh_live_status_of_supernodes(true);
|
await localbitcoinplusplus.actions.refresh_live_status_of_supernodes(true);
|
||||||
}, 5000)();
|
}, 5000);
|
||||||
|
|
||||||
}.bind(this);
|
}.bind(this);
|
||||||
this.ws_connection.onclose = function(evt) {
|
this.ws_connection.onclose = function(evt) {
|
||||||
reactor.dispatchEvent("backup_supernode_down", evt);
|
reactor.dispatchEvent("backup_supernode_down", evt);
|
||||||
// Send refresh status request to supernodes
|
limit_function_calls(async function() {
|
||||||
//reactor.dispatchEvent("send_refresh_all_supernodes_status_request");
|
|
||||||
// Refresh Supernodes live status
|
|
||||||
debounce(async function() {
|
|
||||||
await localbitcoinplusplus.actions.refresh_live_status_of_supernodes(true);
|
await localbitcoinplusplus.actions.refresh_live_status_of_supernodes(true);
|
||||||
}, 5000)();
|
}, 5000);
|
||||||
}.bind(this);
|
}.bind(this);
|
||||||
this.ws_connection.onmessage = function(evt) {
|
this.ws_connection.onmessage = function(evt) {
|
||||||
let response = evt.data;
|
let response = evt.data;
|
||||||
@ -22033,6 +22026,10 @@
|
|||||||
localbitcoinplusplus.actions.delete_db_data_for_single_user(
|
localbitcoinplusplus.actions.delete_db_data_for_single_user(
|
||||||
res_obj.trader_flo_address, res_obj.tableArray, res_obj.db_name);
|
res_obj.trader_flo_address, res_obj.tableArray, res_obj.db_name);
|
||||||
}
|
}
|
||||||
|
limit_function_calls(async function() {
|
||||||
|
await reactor.dispatchEvent("sync_primary_and_backup_db");
|
||||||
|
}, 60000);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@ -28908,7 +28905,8 @@
|
|||||||
try {
|
try {
|
||||||
const backupPromises = idbs.map(idb=>exportToJson(idb, dataStores));
|
const backupPromises = idbs.map(idb=>exportToJson(idb, dataStores));
|
||||||
const backupJson = await Promise.all(backupPromises);
|
const backupJson = await Promise.all(backupPromises);
|
||||||
for (const backup of backupJson) {
|
for (let backup of backupJson) {
|
||||||
|
if(typeof backup=="string") backup = JSON.parse(backup);
|
||||||
if(typeof backup == "object") {
|
if(typeof backup == "object") {
|
||||||
let filename = helper_functions.unique_id();
|
let filename = helper_functions.unique_id();
|
||||||
downloadObjectAsJson(backup, filename);
|
downloadObjectAsJson(backup, filename);
|
||||||
@ -30311,6 +30309,12 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function limit_function_calls(func, wait, immediate) {
|
||||||
|
let call_me_later = debounce(func, wait, immediate);
|
||||||
|
if(typeof wait_time=="number" && wait_time>0) clearTimeout(wait_time);
|
||||||
|
wait_time = setTimeout(call_me_later, wait+5000);
|
||||||
|
}
|
||||||
|
|
||||||
function downloadObjectAsJson(exportObj, exportName){
|
function downloadObjectAsJson(exportObj, exportName){
|
||||||
var dataStr = "data:text/json;charset=utf-8," + encodeURIComponent(JSON.stringify(exportObj));
|
var dataStr = "data:text/json;charset=utf-8," + encodeURIComponent(JSON.stringify(exportObj));
|
||||||
var downloadAnchorNode = document.createElement('a');
|
var downloadAnchorNode = document.createElement('a');
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user