From 0852ed033b0532e77c86ef3fe09c8ff0244dba29 Mon Sep 17 00:00:00 2001 From: Igor Gassmann Date: Tue, 12 Dec 2017 15:24:46 -0300 Subject: [PATCH] Fix settings page throws error on development (https://github.com/lbryio/lbry-app/issues/839) --- src/renderer/redux/actions/settings.js | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/src/renderer/redux/actions/settings.js b/src/renderer/redux/actions/settings.js index 01185085e..06b82e9ee 100644 --- a/src/renderer/redux/actions/settings.js +++ b/src/renderer/redux/actions/settings.js @@ -7,10 +7,6 @@ import lbry from "lbry"; import fs from "fs"; import http from "http"; -const { remote } = require("electron"); -const { extname } = require("path"); -const { readdir } = remote.require("fs"); - export function doFetchDaemonSettings() { return function(dispatch, getState) { lbry.settings_get().then(settings => { @@ -52,22 +48,14 @@ export function doSetClientSetting(key, value) { export function doGetThemes() { return function(dispatch, getState) { - const dir = `${staticResourcesPath}/themes`; + const themes = ["light", "dark"]; + dispatch( + doSetClientSetting( + settings.THEMES, + themes + ) + ); - readdir(dir, (error, files) => { - if (!error) { - dispatch( - doSetClientSetting( - settings.THEMES, - files - .filter(file => extname(file) === ".css") - .map(file => file.replace(".css", "")) - ) - ); - } else { - dispatch(doAlertError(error)); - } - }); }; }