Skip to content
This repository has been archived by the owner on Jun 16, 2023. It is now read-only.

Commit

Permalink
Merge pull request #26
Browse files Browse the repository at this point in the history
Release v0.3.0-rc2
  • Loading branch information
bsrinivas8687 authored Mar 3, 2021
2 parents 15501ae + e8429d9 commit ee0ce15
Show file tree
Hide file tree
Showing 14 changed files with 90 additions and 64 deletions.
1 change: 0 additions & 1 deletion build.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ builder.build({
],
},
mac: {
strictVerify: false,
category: 'public.app-category.utilities',
icon: './electron/icon.icns',
},
Expand Down
29 changes: 29 additions & 0 deletions electron/api.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
const { ipcRenderer } = require('electron');
const {
MANAGER_START_REQUEST,
MANAGER_START_RESPONSE,
MANAGER_LISTEN_URL_GET_REQUEST,
} = require('./channels');

module.exports = {
sendSync: {
manager: {
listenURL: () => ipcRenderer.sendSync(MANAGER_LISTEN_URL_GET_REQUEST),
},
},
send: {
manager: {
startRequest: () => ipcRenderer.send(MANAGER_START_REQUEST),
},
},
on: {
manager: {
startResponse: (func) => ipcRenderer.on(MANAGER_START_RESPONSE, func),
},
},
removeAllListeners: {
manager: {
startResponse: () => ipcRenderer.removeAllListeners(MANAGER_START_RESPONSE),
},
},
};
6 changes: 3 additions & 3 deletions electron/channels.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
MANAGER_LISTEN_URL_GET_REQ: 'MANAGER_LISTEN_URL_GET_REQ',
MANAGER_START_REQ: 'MANAGER_START_REQ',
MANAGER_START_RES: 'MANAGER_START_RES',
MANAGER_LISTEN_URL_GET_REQUEST: 'MANAGER_LISTEN_URL_GET_REQUEST',
MANAGER_START_REQUEST: 'MANAGER_START_REQUEST',
MANAGER_START_RESPONSE: 'MANAGER_START_RESPONSE',
};
2 changes: 1 addition & 1 deletion electron/icon.png
6 changes: 5 additions & 1 deletion electron/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ const createMainWindow = () => {
minWidth: 852,
title: 'Sentinel',
webPreferences: {
enableWebSQL: false,
preload: path.join(__dirname, 'preload.js'),
webgl: false,
},
width: 1280,
});
Expand All @@ -40,7 +42,9 @@ app.on('window-all-closed', () => {
});

app.on('will-quit', () => {
globals.manager.kill();
if (globals.manager) {
globals.manager.kill();
}
});

app.on('activate', () => {
Expand Down
18 changes: 9 additions & 9 deletions electron/ipc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@ const path = require('path');
const { spawn } = require('child_process');
const { ipcMain } = require('electron');
const {
MANAGER_LISTEN_URL_GET_REQ,
MANAGER_START_REQ,
MANAGER_START_RES,
MANAGER_LISTEN_URL_GET_REQUEST,
MANAGER_START_REQUEST,
MANAGER_START_RESPONSE,
} = require('./channels');
const globals = require('./globals');

ipcMain.on(MANAGER_LISTEN_URL_GET_REQ, (event, args) => {
console.log('EVENT:', MANAGER_LISTEN_URL_GET_REQ, 'ARGS:', args);
ipcMain.on(MANAGER_LISTEN_URL_GET_REQUEST, (event, args) => {
console.log('EVENT:', event, 'ARGS:', args);

event.returnValue = globals.listenURL;
});

ipcMain.on(MANAGER_START_REQ, (event, args) => {
console.log('EVENT:', MANAGER_START_REQ, 'ARGS:', args);
ipcMain.on(MANAGER_START_REQUEST, (event, args) => {
console.log('EVENT:', event, 'ARGS:', args);

const manager = spawn(
path.join(__dirname, '../bin/manager'),
Expand All @@ -35,7 +35,7 @@ ipcMain.on(MANAGER_START_REQ, (event, args) => {
}

error = true;
globals.window.webContents.send(MANAGER_START_RES, {
globals.window.webContents.send(MANAGER_START_RESPONSE, {
success: false,
data,
});
Expand All @@ -49,7 +49,7 @@ ipcMain.on(MANAGER_START_REQ, (event, args) => {
}

success = true;
globals.window.webContents.send(MANAGER_START_RES, {
globals.window.webContents.send(MANAGER_START_RESPONSE, {
success: true,
data,
});
Expand Down
5 changes: 3 additions & 2 deletions electron/preload.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const { ipcRenderer } = require('electron');
const { contextBridge } = require('electron');
const api = require('./api');

window.ipcRenderer = ipcRenderer;
contextBridge.exposeInMainWorld('electron', api);
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sentinel",
"version": "0.3.0-rc1",
"version": "0.3.0-rc2",
"main": "./electron/index.js",
"homepage": "./",
"description": "Sentinel desktop and web client.",
Expand All @@ -21,7 +21,7 @@
"axios": "^0.21.1",
"bech32": "^2.0.0",
"bootstrap": "^4.6.0",
"electron": "^11.3.0",
"electron": "^12.0.0",
"electron-builder": "^22.10.5",
"env-cmd": "^10.1.0",
"eslint": "^7.21.0",
Expand All @@ -36,7 +36,7 @@
"prop-types": "^15.7.2",
"qrcode.react": "^1.0.1",
"react": "^17.0.1",
"react-bootstrap": "^1.5.0",
"react-bootstrap": "^1.5.1",
"react-copy-to-clipboard": "^5.0.3",
"react-dom": "^17.0.1",
"react-download-link": "^2.3.0",
Expand Down
1 change: 0 additions & 1 deletion src/constants/channels.js

This file was deleted.

2 changes: 1 addition & 1 deletion src/containers/Configuration/Submit.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const Submit = (props) => {
return;
}

props.onClick((error) => {
props.onClick(null, (error) => {
if (error) {
return;
}
Expand Down
17 changes: 8 additions & 9 deletions src/containers/Splash/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import * as PropTypes from 'prop-types';
import { MANAGER_LISTEN_URL_GET_REQ, MANAGER_START_REQ, MANAGER_START_RES } from '../../constants/channels';
import { connect } from 'react-redux';
import { isManagerRunning } from '../../utils/manager';
import { setSplashStatus } from '../../actions/splash';
Expand All @@ -15,29 +14,29 @@ const Splash = ({
setSplashStatus,
}) => {
useEffect(() => {
const { ipcRenderer } = window;
if (ipcRenderer === undefined) {
const { electron } = window;
if (electron === undefined) {
setSplashStatus({
completed: 150,
message: 'THE MANAGER IS RUNNING SUCCESSFULLY',
});
return;
}

globals.listenURL = ipcRenderer.sendSync(MANAGER_LISTEN_URL_GET_REQ);
globals.listenURL = electron.sendSync.manager.listenURL();
setSplashStatus({
completed: 10,
message: 'RECEIVED MANAGER LISTEN URL FROM THE MAIN PROCESS',
});

ipcRenderer.send(MANAGER_START_REQ);
electron.send.manager.startRequest();
setSplashStatus({
completed: 30,
message: `STARTING THE MANAGER ON URL: ${globals.listenURL}`,
});

ipcRenderer.on(MANAGER_START_RES, (event, args) => {
console.log('EVENT:', MANAGER_START_RES, 'ARGS:', args);
electron.on.manager.startResponse((event, args) => {
console.log('EVENT:', event, 'ARGS:', args);

if (args.success === true) {
setSplashStatus({
Expand All @@ -46,7 +45,7 @@ const Splash = ({
});

isManagerRunning((error) => {
ipcRenderer.removeAllListeners(MANAGER_START_RES);
electron.removeAllListeners.manager.startResponse();

if (error) {
setSplashStatus({
Expand All @@ -62,7 +61,7 @@ const Splash = ({
});
});
} else {
ipcRenderer.removeAllListeners(MANAGER_START_RES);
electron.removeAllListeners.manager.startResponse();
setSplashStatus({
completed: 100,
message: 'THE MANAGER EXITED UNEXPECTEDLY',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,34 @@ import Icon from '../../../components/Icon';
import React from 'react';
import TextBox from '../../../components/TextBox';

const ShowList = ({ showKeysListModal }) => {
const Manage = ({ showKeysListModal }) => {
const onClick = () => {
showKeysListModal();
};

return (
<Dropdown.Item
key="viewKeys"
title="Show keys"
title="Manage keys"
onClick={onClick}>
<Icon
className="icon"
icon="keys"
/>
<TextBox
className="dropdown-item-text"
value="Show keys"
value="Manage keys"
/>
</Dropdown.Item>
);
};

ShowList.propTypes = {
Manage.propTypes = {
showKeysListModal: PropTypes.func.isRequired,
};

const actionsToProps = {
showKeysListModal: showKeysListModal,
};

export default connect(null, actionsToProps)(ShowList);
export default connect(null, actionsToProps)(Manage);
4 changes: 2 additions & 2 deletions src/containers/Wallet/Keys/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import * as PropTypes from 'prop-types';
import { connect } from 'react-redux';
import Dropdown from '../../../components/Dropdown';
import Icon from '../../../components/Icon';
import Manage from './Manage';
import ModalConfiguration from '../../common/ModalConfiguration';
import ModalCreate from './ModalCreate';
import ModalInfo from './ModalInfo';
import ModalList from './ModalList';
import React from 'react';
import Settings from './Settings';
import ShowList from './ShowList';
import TextBox from '../../../components/TextBox';

const Keys = ({
Expand All @@ -33,7 +33,7 @@ const Keys = ({
/>
</Dropdown.Toggle>
<Dropdown.Menu>
<ShowList/>
<Manage/>
<Settings/>
</Dropdown.Menu>
</Dropdown>
Expand Down
47 changes: 21 additions & 26 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1948,16 +1948,11 @@
resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d"
integrity sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==

"@types/node@*":
"@types/node@*", "@types/node@^14.6.2":
version "14.14.31"
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.31.tgz#72286bd33d137aa0d152d47ec7c1762563d34055"
integrity sha512-vFHy/ezP5qI0rFgJ7aQnjDXwAMrG0KqqIH7tQG5PPv3BWBayOPIQNBjVc/P6hhdZfMx51REc6tfDNXHUio893g==

"@types/node@^12.0.12":
version "12.20.4"
resolved "https://registry.yarnpkg.com/@types/node/-/node-12.20.4.tgz#73687043dd00fcb6962c60fbf499553a24d6bdf2"
integrity sha512-xRCgeE0Q4pT5UZ189TJ3SpYuX/QGl6QIAOAIeDSbAVAd2gX1NxSZup4jNVK7cxIeP8KDSbJgcckun495isP1jQ==

"@types/normalize-package-data@^2.4.0":
version "2.4.0"
resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz#e486d0d97396d79beedd0a6e33f4534ff6b4973e"
Expand All @@ -1977,9 +1972,9 @@
xmlbuilder ">=11.0.1"

"@types/prettier@^2.0.0":
version "2.2.1"
resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.2.1.tgz#374e31645d58cb18a07b3ecd8e9dede4deb2cccd"
integrity sha512-DxZZbyMAM9GWEzXL+BMZROWz9oo6A9EilwwOMET2UVu2uZTqMWS5S69KVtuVKaRjCUpcrOXRalet86/OpG4kqw==
version "2.2.2"
resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.2.2.tgz#e2280c89ddcbeef340099d6968d8c86ba155fdf6"
integrity sha512-i99hy7Ki19EqVOl77WplDrvgNugHnsSjECVR/wUrzw2TJXz1zlUfT2ngGckR6xN7yFYaijsMAqPkOLx9HgUqHg==

"@types/prop-types@*", "@types/prop-types@^15.7.3":
version "15.7.3"
Expand Down Expand Up @@ -4963,17 +4958,17 @@ [email protected]:
mime "^2.5.0"

electron-to-chromium@^1.3.564, electron-to-chromium@^1.3.649:
version "1.3.677"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.677.tgz#b5d586b0d1976c97cc7e95262677ac5944199513"
integrity sha512-Tcmk+oKQgpjcM+KYanlkd76ZtpzalkpUULnlJDP6vjHtR7UU564IM9Qv5DxqHZNBQjzXm6mkn7Y8bw2OoE3FmQ==
version "1.3.678"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.678.tgz#c7c6960463167126b7ed076fade14cac6223bfff"
integrity sha512-E5ha1pE9+aWWrT2fUD5wdPBWUnYtKnEnloewbtVyrkAs79HvodOiNO4rMR94+hKbxgMFQG4fnPQACOc1cfMfBg==

electron@^11.3.0:
version "11.3.0"
resolved "https://registry.yarnpkg.com/electron/-/electron-11.3.0.tgz#87e8528fd23ae53b0eeb3a738f1fe0a3ad27c2db"
integrity sha512-MhdS0gok3wZBTscLBbYrOhLaQybCSAfkupazbK1dMP5c+84eVMxJE/QGohiWQkzs0tVFIJsAHyN19YKPbelNrQ==
electron@^12.0.0:
version "12.0.0"
resolved "https://registry.yarnpkg.com/electron/-/electron-12.0.0.tgz#b3b1d88cc64622e59c637521da5a6b6ab4df4eb5"
integrity sha512-p6oxZ4LG82hopPGAsIMOjyoL49fr6cexyFNH0kADA9Yf+mJ72DN7bjvBG+6V7r6QKhwYgsSsW8RpxBeVOUbxVQ==
dependencies:
"@electron/get" "^1.0.1"
"@types/node" "^12.0.12"
"@types/node" "^14.6.2"
extract-zip "^1.0.3"

elliptic@^6.5.3:
Expand Down Expand Up @@ -10410,10 +10405,10 @@ react-app-polyfill@^2.0.0:
regenerator-runtime "^0.13.7"
whatwg-fetch "^3.4.1"

react-bootstrap@^1.5.0:
version "1.5.0"
resolved "https://registry.yarnpkg.com/react-bootstrap/-/react-bootstrap-1.5.0.tgz#86e4bd05ca3a0bd7486f7046643e9be5e2d86bbd"
integrity sha512-t1o4kP3coj2HIaBepJxGAc7HZ1fWGria/s0Yr9JUmNkCilyrnXtK209qn28vuZ4muhnA0uR0GMMXAMrLsLyiIw==
react-bootstrap@^1.5.1:
version "1.5.1"
resolved "https://registry.yarnpkg.com/react-bootstrap/-/react-bootstrap-1.5.1.tgz#47cda280b5208c8a9f24d04dafd38d9d90c9695c"
integrity sha512-jbJNGx9n4JvKgxlvT8DLKSeF3VcqnPJXS9LFdzoZusiZCCGoYecZ9qSCBH5n2A+kjmuura9JkvxI9l7HD+bIdQ==
dependencies:
"@babel/runtime" "^7.4.2"
"@restart/context" "^2.1.4"
Expand All @@ -10429,7 +10424,7 @@ react-bootstrap@^1.5.0:
invariant "^2.2.4"
prop-types "^15.7.2"
prop-types-extra "^1.1.0"
react-overlays "^4.1.1"
react-overlays "^5.0.0"
react-transition-group "^4.4.1"
uncontrollable "^7.0.0"
warning "^4.0.3"
Expand Down Expand Up @@ -10508,10 +10503,10 @@ react-lifecycles-compat@^3.0.4:
resolved "https://registry.yarnpkg.com/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz#4f1a273afdfc8f3488a8c516bfda78f872352362"
integrity sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA==

react-overlays@^4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/react-overlays/-/react-overlays-4.1.1.tgz#0060107cbe1c5171a744ccda3fbf0556d064bc5f"
integrity sha512-WtJifh081e6M24KnvTQoNjQEpz7HoLxqt8TwZM7LOYIkYJ8i/Ly1Xi7RVte87ZVnmqQ4PFaFiNHZhSINPSpdBQ==
react-overlays@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/react-overlays/-/react-overlays-5.0.0.tgz#b50351de194dda0706b40f9632d261c9f0011c4c"
integrity sha512-TKbqfAv23TFtCJ2lzISdx76p97G/DP8Rp4TOFdqM9n8GTruVYgE3jX7Zgb8+w7YJ18slTVcDTQ1/tFzdCqjVhA==
dependencies:
"@babel/runtime" "^7.12.1"
"@popperjs/core" "^2.5.3"
Expand Down

0 comments on commit ee0ce15

Please sign in to comment.