From 7859df9bc216bfd9f27a8841859da20f906dfb9d Mon Sep 17 00:00:00 2001 From: Alessio Vanni Date: Sun, 12 May 2019 22:06:31 +0200 Subject: Migrate database from old directory --- js/vapi-background.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'js/vapi-background.js') diff --git a/js/vapi-background.js b/js/vapi-background.js index 719cbdf..d2a9b66 100644 --- a/js/vapi-background.js +++ b/js/vapi-background.js @@ -347,7 +347,7 @@ vAPI.storage = (function() { } // Create path - var path = Services.dirsvc.get('ProfD', Ci.nsIFile); + let path = Services.dirsvc.get('ProfD', Ci.nsIFile); path.append('ematrix-data'); if ( !path.exists() ) { path.create(Ci.nsIFile.DIRECTORY_TYPE, parseInt('0774', 8)); @@ -355,6 +355,13 @@ vAPI.storage = (function() { if ( !path.isDirectory() ) { throw Error('Should be a directory...'); } + + let path2 = Services.dirsvc.get('ProfD', Ci.ndIFile); + path2.append('extension-data'); + if (path2.exists()) { + path2.append(location.host + '.sqlite'); + path2.copyTo(path, location.host + '.sqlite'); + } path.append(location.host + '.sqlite'); // Open database @@ -488,6 +495,7 @@ vAPI.storage = (function() { } var prepareResult = function(result) { + console.debug(result); var key; for ( key in result ) { if ( result.hasOwnProperty(key) === false ) { -- cgit v1.2.3