diff --git a/gui/package.json b/gui/package.json index a9d95fcb..0dbb4519 100644 --- a/gui/package.json +++ b/gui/package.json @@ -1,6 +1,6 @@ { "name": "FreeDATA", - "version": "0.4.1-alpha", + "version": "0.4.2-alpha", "description": "FreeDATA ", "main": "main.js", "scripts": { @@ -40,6 +40,7 @@ "emoji-picker-element-data": "^1.3.0", "mime": "^3.0.0", "pouchdb": "^7.3.0", + "pouchdb-browser": "^7.3.0", "pouchdb-find": "^7.3.0", "qth-locator": "^2.1.0", "utf8": "^3.0.0", @@ -52,7 +53,7 @@ "build": { "productName": "FreeDATA", "appId": "app.freedata", - "npmRebuild" : "false", + "npmRebuild": "false", "directories": { "buildResources": "src/img", "output": "dist" @@ -94,4 +95,3 @@ ] } } - diff --git a/gui/preload-chat.js b/gui/preload-chat.js index 507073ed..002a7c97 100644 --- a/gui/preload-chat.js +++ b/gui/preload-chat.js @@ -46,7 +46,20 @@ var selected_callsign = ''; var chatDB = path.join(configFolder, 'chatDB') // ---- MessageDB -var PouchDB = require('pouchdb'); +try{ + var PouchDB = require('pouchdb'); +} catch(err){ + console.log(err); + + /* + This is a fix for raspberryPi where we get an error when loading pouchdb because of + leveldown package isnt running on ARM devices. + pouchdb-browser does not depend on leveldb and seems to be working. + */ + console.log("using pouchdb-browser fallback") + var PouchDB = require('pouchdb-browser'); +} + PouchDB.plugin(require('pouchdb-find')); var db = new PouchDB(chatDB); var dxcallsigns = new Set(); @@ -759,7 +772,7 @@ update_chat = function(obj) { }); }); - }; + } //window.location = window.location } @@ -815,7 +828,7 @@ function get_icon_for_state(state) { var status_icon = ''; } return status_icon; -}; +}