Skip to content

Commit d566eda

Browse files
committed
Minor changes for v0.21.1
Updated to use lib-js8call version 1.0.0. Also finally got rid of the annoying "unhandled rejection" message if running under the terminal when JS8Call is not connected. Increased the default width of the main window to avoid a horizontal scroll bar when running under Windows.
1 parent 84b0d64 commit d566eda

File tree

5 files changed

+113
-115
lines changed

5 files changed

+113
-115
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,3 +109,10 @@ clicking on the symbol with three dots to the left of the title.
109109

110110
There is an option to delete entries by right clicking on a row and also there are
111111
right click menu items that replicate what the buttons below do.
112+
113+
# Credits
114+
115+
Many thanks to Rikki Tripp for his excellent library lib-js8call and for providing
116+
great feedback and assistance during the development of this application.
117+
118+
Lib-js8call can be found here: https://www.npmjs.com/package/@trippnology/lib-js8call

config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ var config = {};
55
// The default data directory for QSO data is '~/.js8assistant/qsodata'.
66
// Put the full path here if you don't want the default data directory
77
// but make sure that the directory you want to use already exists.
8-
config.qsodatadir = "";
8+
config.qsodatadir = "/Users/rick/Dropbox/JS8Call/qsodata";
99

1010
module.exports = config;

main.js

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ console.log(logPath);
4444
let win; // the main application window
4545
let winQsoHistory; // the window for QSO History
4646
let winHeight;
47+
let winWidth;
4748
let connected = false; // this is to track the state of the JS8Call API connection
4849

4950
var config = require('./config');
@@ -102,10 +103,14 @@ process.on('unhandledRejection', (error, p) => {
102103
if(process.platform !== 'darwin')
103104
{
104105
winHeight = 740; // make room for the menu bar for windows and linux
106+
winWidth = 864;
105107
//menuTemplate.unshift({}); // Needed for Windows???
106108
}
107109
else
110+
{
108111
winHeight = 700;
112+
winWidth = 847;
113+
}
109114

110115
let storageLocation = app.getPath('userData');
111116
let nodeStorage = new JSONStorage(storageLocation);
@@ -163,7 +168,7 @@ if(!mainWindowState)
163168
console.log('Create a default mainWindowState');
164169

165170
mainWindowState = {};
166-
mainWindowState.bounds = { width: 847, height: winHeight };
171+
mainWindowState.bounds = { width: winWidth, height: winHeight };
167172
}
168173

169174
if(!qsoWindowState)
@@ -496,7 +501,15 @@ function timeoutCheck()
496501
{
497502
if(!connected)
498503
{
499-
js8.tcp.connect();
504+
js8.tcp
505+
.connect()
506+
//.then(() => {
507+
// console.log('TCP connected');
508+
//})
509+
.catch((err) => {
510+
console.log("TCP can't connect yet, waiting for JS8Call...");
511+
//console.error(err);
512+
});
500513
}
501514
}
502515

@@ -542,10 +555,10 @@ js8.on('tcp.disconnected', (s) => {
542555
win.webContents.send('apistatus', "disconnected"); // indicate in UI we are disconnected
543556
});
544557

545-
js8.on('tcp.error', (e) => { // NOTE: this doesn't seem to prevent the "Unhandled rejection" message unfortunately
558+
js8.on('tcp.error', (e) => {
546559
// tcp error
547-
console.log('TCP error!');
548-
console.log(e);
560+
//console.log('TCP error!');
561+
//console.log(e);
549562
});
550563

551564
process.on('error', (e) => {

0 commit comments

Comments
 (0)