Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "scatter",
"version": "8.6.0",
"version": "8.7.0",
"description": "Scatter Desktop Companion",
"private": true,
"main": "electron.js",
Expand Down
9 changes: 0 additions & 9 deletions src/models/alerts/Alert.js

This file was deleted.

1 change: 0 additions & 1 deletion src/services/KeyPairService.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import {BlockchainsArray, Blockchains} from '../models/Blockchains';
import PluginRepository from '../plugins/PluginRepository'
import * as Actions from '../store/constants';

import Alert from '../models/alerts/Alert'
import PopupService from '../services/PopupService'
import {Popup} from '../models/popups/Popup'

Expand Down
1 change: 0 additions & 1 deletion src/services/QRService.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import StorageService from '../services/StorageService';
export default class QRService {

static createQR(data){
//TODO: Needs to include salt
const qrData = JSON.stringify({data, salt:StorageService.getSalt()});
return QRCode.toDataURL(qrData,{ errorCorrectionLevel: 'L' });
}
Expand Down
40 changes: 0 additions & 40 deletions src/services/RSAService.js

This file was deleted.

59 changes: 0 additions & 59 deletions src/util/ObjectHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,6 @@
*/
export default class ObjectHelpers {

/***
* Groups an array by key
* @param array
* @param key
* @returns {*}
*/
static groupBy(array, key){
return array.reduce((acc, item) => {
(acc[item[key]] = acc[item[key]] || []).push(item);
return acc;
}, {});
}

/***
* Makes a single level array distinct
* @param array
Expand All @@ -25,29 +12,6 @@ export default class ObjectHelpers {
return array.reduce((a,b) => (a.includes(b)) ? a : a.concat(b), []);
}

/***
* Makes an object array distinct ( uses deep checking )
* @param array
* @returns {*}
*/
static distinctObjectArray(array){
return array.reduce((a,b) => (!!a.find(x => this.deepEqual(x, b))) ? a : a.concat(b), []);
}

/***
* Checks deep equality for objects
* @param objA
* @param objB
* @returns {boolean}
*/
static deepEqual(objA, objB) {
const keys = Object.keys, typeA = typeof objA, typeB = typeof objB;
return objA && objB && typeA === 'object' && typeA === typeB ? (
keys(objA).length === keys(objB).length &&
keys(objA).every(key => this.deepEqual(objA[key], objB[key]))
) : (objA === objB);
}

/***
* Flattens an array into a single dimension
* @param array
Expand All @@ -59,27 +23,4 @@ export default class ObjectHelpers {
);
}

/***
* Flattens an objects keys into a single dimension
* @param object
* @returns {*}
*/
static objectToFlatKeys(object){
return this.flatten(Object.keys(object).map(key => {
if(object[key] !== null && typeof object[key] === 'object') return this.objectToFlatKeys(object[key])
else return key;
}))
}

/***
* Gets a field from an object by string dot notation, such as `location.country.code`
* @param object
* @param dotNotation
* @returns {*}
*/
static getFieldFromObjectByDotNotation(object, dotNotation){
let props = dotNotation.split(".");
return props.reduce((obj,key)=> obj[key], object)
}

}