Merge pull request #1764 from hicom150/remove_deep_equal

Remove deep-equal dependency
This commit is contained in:
Diego Rodríguez Baquero
2020-01-04 13:07:57 -05:00
committed by GitHub
2 changed files with 2 additions and 3 deletions

View File

@@ -21,7 +21,6 @@
"chromecasts": "^1.9.1",
"create-torrent": "^4.4.1",
"debounce": "^1.2.0",
"deep-equal": "^1.1.0",
"dlnacasts": "^0.1.0",
"drag-drop": "^6.0.0",
"es6-error": "^4.1.1",

View File

@@ -3,7 +3,7 @@
console.time('init')
const crypto = require('crypto')
const deepEqual = require('deep-equal')
const util = require('util')
const defaultAnnounceList = require('create-torrent').announceList
const electron = require('electron')
const fs = require('fs')
@@ -249,7 +249,7 @@ function generateTorrentPoster (torrentKey) {
function updateTorrentProgress () {
const progress = getTorrentProgress()
// TODO: diff torrent-by-torrent, not once for the whole update
if (prevProgress && deepEqual(progress, prevProgress, { strict: true })) {
if (prevProgress && util.isDeepStrictEqual(progress, prevProgress)) {
return /* don't send heavy object if it hasn't changed */
}
ipc.send('wt-progress', progress)