Skip to content

Commit

Permalink
implemented protocol and shortcut selection
Browse files Browse the repository at this point in the history
  • Loading branch information
felixkoch committed Feb 17, 2019
1 parent 1df0225 commit 41433aa
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/callSnom.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default function callSnom(options, cb) {
const number = encodeURIComponent(parseIncompletePhoneNumber(options.number));

const request = (electron.net || electron.remote.net).request(
`http://${options.ip}/command.htm?number=${number}`
`${options.protocol}://${options.ip}/command.htm?number=${number}`
//`http://${options.ip}/command.php?number=${number}`
);

Expand Down
1 change: 1 addition & 0 deletions app/components/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ class App extends Component {

callSnom(
{
protocol: this.store.get('protocol', 'http'),
ip: this.store.get('ip'),
user: this.store.get('user'),
password: this.store.get('password'),
Expand Down
8 changes: 5 additions & 3 deletions app/main.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ if (!gotTheLock) {

callSnom(
{
protocol: store.get('protocol', 'http'),
ip: store.get('ip'),
user: store.get('user'),
password: store.get('password'),
Expand Down Expand Up @@ -158,7 +159,7 @@ if (!gotTheLock) {
mainWindow = new BrowserWindow({
show: false,
width: 400,
height: 500
height: 650
});

mainWindow.loadURL(`file://${__dirname}/app.html`);
Expand Down Expand Up @@ -238,11 +239,12 @@ if (!gotTheLock) {
// Remove this if your app does not use auto updates
// eslint-disable-next-line
new AppUpdater();

const ret = globalShortcut.register('CommandOrControl+D', () => {
const store = new Store();
const ret = globalShortcut.register(store.get('shortcut', 'CmdOrCtrl+D'), () => {
const store = new Store();
callSnom(
{
protocol: store.get('protocol', 'http'),
ip: store.get('ip'),
user: store.get('user'),
password: store.get('password'),
Expand Down

0 comments on commit 41433aa

Please sign in to comment.