Skip to content
This repository has been archived by the owner on Jan 6, 2022. It is now read-only.

Commit

Permalink
fix: use latest dat-node for network improvements with hyperswarm
Browse files Browse the repository at this point in the history
  • Loading branch information
okdistribute committed Mar 27, 2020
1 parent 8acf171 commit 8c1224d
Show file tree
Hide file tree
Showing 4 changed files with 1,798 additions and 1,191 deletions.
4 changes: 2 additions & 2 deletions app/actions/dat-middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -367,14 +367,14 @@ export default class DatMiddleware {
? 'paused'
: dat.writable || dat.progress === 1
? 'complete'
: dat.network.connected ? 'loading' : 'stale'
: dat.network.connections.size ? 'loading' : 'stale'
this.dispatch({ type: 'DAT_STATE', key, state })
}

updateConnections (dat) {
if (!dat.network) return
const key = encode(dat.key)
this.dispatch({ type: 'DAT_PEERS', key, peers: dat.network.connected })
this.dispatch({ type: 'DAT_PEERS', key, peers: dat.network.connections.size })
}

joinNetwork (dat) {
Expand Down
15 changes: 0 additions & 15 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ const { app, BrowserWindow, shell, Menu, ipcMain } = require('electron')
const { neutral } = require('dat-colors')
const autoUpdater = require('./lib/auto-updater')
const defaultMenu = require('electron-default-menu')
const doctor = require('dat-doctor')
const path = require('path')
const isDev = process.env.NODE_ENV === 'development'
const isTest = process.env.NODE_ENV === 'test'
const { Writable } = require('stream')

if (typeof process.env.NODE_V === 'string' && process.env.NODE_V !== process.version) {
console.error(`
Expand All @@ -25,19 +23,6 @@ if (typeof process.env.NODE_V === 'string' && process.env.NODE_V !== process.ver
}

const menu = defaultMenu(app, shell)
menu[menu.length - 1].submenu.push({
label: 'Doctor',
click: () => {
win.webContents.openDevTools({ mode: 'detach' })
const out = Writable({
write (chunk, env, done) {
if (win) win.webContents.send('log', chunk.toString())
done()
}
})
doctor({ out })
}
})

let win
let watchProcess
Expand Down
Loading

0 comments on commit 8c1224d

Please sign in to comment.