fixed export idb functions
This commit is contained in:
parent
cfa900cb5c
commit
e5cbf58787
28
index.html
28
index.html
@ -21358,6 +21358,7 @@
|
|||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
readDB("localbitcoinUser", "00-01").then(async function(idbData) {
|
readDB("localbitcoinUser", "00-01").then(async function(idbData) {
|
||||||
if (
|
if (
|
||||||
|
typeof idbData !== "object" ||
|
||||||
typeof idbData.myLocalFLOPublicKey == "undefined" ||
|
typeof idbData.myLocalFLOPublicKey == "undefined" ||
|
||||||
idbData.myLocalFLOPublicKey.trim() == ""
|
idbData.myLocalFLOPublicKey.trim() == ""
|
||||||
) {
|
) {
|
||||||
@ -27850,6 +27851,7 @@
|
|||||||
transaction.addEventListener('error', reject)
|
transaction.addEventListener('error', reject)
|
||||||
|
|
||||||
for (const storeName of idbDatabase.objectStoreNames) {
|
for (const storeName of idbDatabase.objectStoreNames) {
|
||||||
|
if(dataStores.length>0 && !dataStores.includes(storeName)) continue;
|
||||||
const allObjects = []
|
const allObjects = []
|
||||||
transaction
|
transaction
|
||||||
.objectStore(storeName)
|
.objectStore(storeName)
|
||||||
@ -28903,12 +28905,11 @@
|
|||||||
localbitcoinplusplus.IdbBackup = {
|
localbitcoinplusplus.IdbBackup = {
|
||||||
exportIDBtoFile: async function(idbs=[], dataStores=[]) {
|
exportIDBtoFile: async function(idbs=[], dataStores=[]) {
|
||||||
try {
|
try {
|
||||||
const backupPromises = idbs.map(idb=>exportToJson(idb, dataStores));
|
for (const idb of idbs) {
|
||||||
const backupJson = await Promise.all(backupPromises);
|
let backup = await exportToJson(idb, dataStores);
|
||||||
for (let backup of backupJson) {
|
|
||||||
if(typeof backup=="string") backup = JSON.parse(backup);
|
if(typeof backup=="string") backup = JSON.parse(backup);
|
||||||
if(typeof backup == "object") {
|
if(typeof backup == "object") {
|
||||||
let filename = helper_functions.unique_id();
|
let filename = `${idb.name}__${helper_functions.unique_id()}`;
|
||||||
downloadObjectAsJson(backup, filename);
|
downloadObjectAsJson(backup, filename);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -29204,25 +29205,6 @@
|
|||||||
// If connected with Backup Supernode, request it to sync data.
|
// If connected with Backup Supernode, request it to sync data.
|
||||||
const closestSuList = await readAllDB("myClosestSupernodes");
|
const closestSuList = await readAllDB("myClosestSupernodes");
|
||||||
|
|
||||||
// If you are a supernode ask if you want to sync primary and secondary backup
|
|
||||||
// if (
|
|
||||||
// localbitcoinplusplus.master_configurations.supernodesPubKeys.includes(
|
|
||||||
// localbitcoinplusplus.wallets.my_local_flo_public_key
|
|
||||||
// )
|
|
||||||
// ) {
|
|
||||||
// const wannaSync = confirm(
|
|
||||||
// `Do you want to sync Primary and Backup Databases?`
|
|
||||||
// );
|
|
||||||
// if (wannaSync == true) {
|
|
||||||
// reactor.dispatchEvent("sync_primary_and_backup_db");
|
|
||||||
// } else {
|
|
||||||
// localbitcoinplusplus.services[
|
|
||||||
// `can_serve_${localbitcoinplusplus.wallets.my_local_flo_address}`
|
|
||||||
// ] = true;
|
|
||||||
// reactor.dispatchEvent("remove_extra_backup_connections");
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
if (!closestSuList[0].is_live) {
|
if (!closestSuList[0].is_live) {
|
||||||
const switchMyWS = new backupSupernodesWebSocketObject();
|
const switchMyWS = new backupSupernodesWebSocketObject();
|
||||||
const connectedWSServerFloId = await switchMyWS.getFloIdFromWSUrl(
|
const connectedWSServerFloId = await switchMyWS.getFloIdFromWSUrl(
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user