mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-13 15:09:42 +00:00
* Updates package versions
* Updating versions with RCs
* Updated landing page with stock images
* Begins refactoring of websocket
Adds Help component
* Dark theme for charts
* event Event
* Adds cryptocurrency font
Updates wallet to use it
* Rejigs the location of assets
* rxjs update
wallet font correction
* renaming websocket service
* Refactors websocket use
Destroys and subscribes appropriately
Also handles when websocket is not available with intervals
* Fixes issues with electron by rebasing with Maxime GRIS electron builder
* License change
* Readme update
* Parses available and enabled currencies to create an object {Name:X, Enabled:Y}
* Adds methods to convert from string arrays to objects with enabled status for all currencies
* Uses a localstorage cache for config for 15 minutes
* Moves handling of settings to config object
* Fix typescripting
* Fixes issue with saving and loading
* Slows websocket repeats
Adds cool new dictionary style item and iterable.
Updatres currency-list.component to list all enabled currencies and exchanges (still doesn't do anything)
* Updates selected-currency.component to display all currencies ticker updates if there is no selected currency
Will display only selected currency results once it is set
Sets a new property to ensure all currency names are consistent for currency list plans
* Fixes issue where only one component could listen to the websocket at once
Allows you to select a currency in exchange grid mode
* Adds selected currency support to buy & sell components
Updates selected currency ticker to update on change faster
* Adds Online status indicator
* Removal of console.logs for working features
* Allows currency-list.component to aggregate on currency and list exchanges that match it
* Highlights selected currency in currency-list.component
Allows you to select a currency
79 lines
1.9 KiB
TypeScript
79 lines
1.9 KiB
TypeScript
import { app, BrowserWindow, screen } from 'electron';
|
|
import * as path from 'path';
|
|
import * as url from 'url';
|
|
|
|
let win, serve;
|
|
const args = process.argv.slice(1);
|
|
serve = args.some(val => val === '--serve');
|
|
|
|
try {
|
|
require('dotenv').config();
|
|
} catch {
|
|
console.log('asar');
|
|
}
|
|
|
|
function createWindow() {
|
|
|
|
const electronScreen = screen;
|
|
const size = electronScreen.getPrimaryDisplay().workAreaSize;
|
|
|
|
// Create the browser window.
|
|
win = new BrowserWindow({
|
|
x: 0,
|
|
y: 0,
|
|
width: size.width,
|
|
height: size.height
|
|
});
|
|
|
|
if (serve) {
|
|
require('electron-reload')(__dirname, {
|
|
electron: require(`${__dirname}/node_modules/electron`)});
|
|
win.loadURL('http://localhost:4200');
|
|
} else {
|
|
win.loadURL(url.format({
|
|
pathname: path.join(__dirname, 'dist/index.html'),
|
|
protocol: 'file:',
|
|
slashes: true
|
|
}));
|
|
}
|
|
|
|
win.webContents.openDevTools();
|
|
|
|
// Emitted when the window is closed.
|
|
win.on('closed', () => {
|
|
// Dereference the window object, usually you would store window
|
|
// in an array if your app supports multi windows, this is the time
|
|
// when you should delete the corresponding element.
|
|
win = null;
|
|
});
|
|
}
|
|
|
|
try {
|
|
|
|
// This method will be called when Electron has finished
|
|
// initialization and is ready to create browser windows.
|
|
// Some APIs can only be used after this event occurs.
|
|
app.on('ready', createWindow);
|
|
|
|
// Quit when all windows are closed.
|
|
app.on('window-all-closed', () => {
|
|
// On OS X it is common for applications and their menu bar
|
|
// to stay active until the user quits explicitly with Cmd + Q
|
|
if (process.platform !== 'darwin') {
|
|
app.quit();
|
|
}
|
|
});
|
|
|
|
app.on('activate', () => {
|
|
// On OS X it's common to re-create a window in the app when the
|
|
// dock icon is clicked and there are no other windows open.
|
|
if (win === null) {
|
|
createWindow();
|
|
}
|
|
});
|
|
|
|
} catch (e) {
|
|
// Catch Error
|
|
// throw e;
|
|
}
|