Skip to content

Commit

Permalink
chore: remove unused code (#1640)
Browse files Browse the repository at this point in the history
Removes code that's addressed by ipfs/ipfs-webui#1628
  • Loading branch information
rafaelramalho19 committed Sep 14, 2020
1 parent 7da0ff5 commit 56ee074
Showing 1 changed file with 1 addition and 34 deletions.
35 changes: 1 addition & 34 deletions src/webui/preload.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
const toPull = require('stream-to-pull-stream')
const { ipcRenderer, remote } = require('electron')
const readdir = require('recursive-readdir')
const fs = require('fs-extra')
const path = require('path')
const { ipcRenderer } = require('electron')
const screenshotHook = require('./screenshot')
const connectionHook = require('./connection-status')
const { COUNTLY_KEY, VERSION } = require('../common/consts')
Expand Down Expand Up @@ -61,35 +57,6 @@ window.ipfsDesktop = {

version: VERSION,

selectDirectory: async () => {
const response = await remote.dialog.showOpenDialog(remote.getCurrentWindow(), {
title: 'Select a directory',
properties: [
'openDirectory',
'createDirectory'
]
})

if (!response || response.canceled) {
return
}

const files = []
const filesToRead = response.filePaths[0]
const prefix = path.dirname(filesToRead)

for (const path of await readdir(filesToRead)) {
const size = (await fs.stat(path)).size
files.push({
path: path.substring(prefix.length, path.length),
content: toPull.source(fs.createReadStream(path)),
size: size
})
}

return files
},

removeConsent: (consent) => {
ipcRenderer.send('countly.removeConsent', consent)
},
Expand Down

0 comments on commit 56ee074

Please sign in to comment.