From 56ee07499e419e6635ffa85896426aaedf9cd58a Mon Sep 17 00:00:00 2001 From: Rafael Ramalho Date: Mon, 14 Sep 2020 16:52:40 +0100 Subject: [PATCH] chore: remove unused code (#1640) Removes code that's addressed by https://github.com/ipfs-shipyard/ipfs-webui/pull/1628 --- src/webui/preload.js | 35 +---------------------------------- 1 file changed, 1 insertion(+), 34 deletions(-) diff --git a/src/webui/preload.js b/src/webui/preload.js index 6adc8a934..08c6d48d5 100644 --- a/src/webui/preload.js +++ b/src/webui/preload.js @@ -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') @@ -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) },