|  |  | @ -220,22 +220,28 @@ export default class AccountViewView extends Vue { | 
			
		
	
		
			
				
					|  |  |  |         privateHex, | 
			
		
	
		
			
				
					|  |  |  |         UPORT_ROOT_DERIVATION_PATH | 
			
		
	
		
			
				
					|  |  |  |       ); | 
			
		
	
		
			
				
					|  |  |  |       db.open().catch(function (err) { | 
			
		
	
		
			
				
					|  |  |  |         console.error("Failed to open db: " + (err.stack || err)); | 
			
		
	
		
			
				
					|  |  |  |       }); | 
			
		
	
		
			
				
					|  |  |  |       db.accounts | 
			
		
	
		
			
				
					|  |  |  |         .add({ | 
			
		
	
		
			
				
					|  |  |  |           publicKey: newId.keys[0].publicKeyHex, | 
			
		
	
		
			
				
					|  |  |  |           identity: JSON.stringify(newId), | 
			
		
	
		
			
				
					|  |  |  |         }) | 
			
		
	
		
			
				
					|  |  |  |         .then(function () { | 
			
		
	
		
			
				
					|  |  |  |           db.accounts.each(function (account) { | 
			
		
	
		
			
				
					|  |  |  |             console.log("Found close friend: " + account.publicKey); | 
			
		
	
		
			
				
					|  |  |  |       db.open() | 
			
		
	
		
			
				
					|  |  |  |         .then(function (odexie) { | 
			
		
	
		
			
				
					|  |  |  |           odexie._allTables.accounts.count(function (result) { | 
			
		
	
		
			
				
					|  |  |  |             if (result === 0) { | 
			
		
	
		
			
				
					|  |  |  |               console.log("No accounts"); | 
			
		
	
		
			
				
					|  |  |  |               odexie._allTables.accounts | 
			
		
	
		
			
				
					|  |  |  |                 .add({ | 
			
		
	
		
			
				
					|  |  |  |                   publicKey: newId.keys[0].publicKeyHex, | 
			
		
	
		
			
				
					|  |  |  |                   identity: JSON.stringify(newId), | 
			
		
	
		
			
				
					|  |  |  |                 }) | 
			
		
	
		
			
				
					|  |  |  |                 .then(function () { | 
			
		
	
		
			
				
					|  |  |  |                   odexie._allTables.accounts.each(function (account) { | 
			
		
	
		
			
				
					|  |  |  |                     console.log("Found close friend: " + account.publicKey); | 
			
		
	
		
			
				
					|  |  |  |                   }); | 
			
		
	
		
			
				
					|  |  |  |                 }); | 
			
		
	
		
			
				
					|  |  |  |             } else { | 
			
		
	
		
			
				
					|  |  |  |               console.log("Skipping initial create on empty db."); | 
			
		
	
		
			
				
					|  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |           }); | 
			
		
	
		
			
				
					|  |  |  |         }) | 
			
		
	
		
			
				
					|  |  |  |         .catch(function (e) { | 
			
		
	
		
			
				
					|  |  |  |           // Something failed. It may be already in the open() call. | 
			
		
	
		
			
				
					|  |  |  |           console.error(e.stack || e); | 
			
		
	
		
			
				
					|  |  |  |         .catch(function (err) { | 
			
		
	
		
			
				
					|  |  |  |           console.error("Failed to open db: " + (err.stack || err)); | 
			
		
	
		
			
				
					|  |  |  |         }); | 
			
		
	
		
			
				
					|  |  |  |       //appStore.dispatch(appSlice.actions.addLog({log: false, msg: "... created new ID..."})) | 
			
		
	
		
			
				
					|  |  |  |       accountStore.account = JSON.stringify(newId); | 
			
		
	
	
		
			
				
					|  |  | 
 |