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

fix: use latest dat-node for network improvements with hyperswarm #649

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
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