From ae033f72650f54c5804134a2ff2a461294b7c2f5 Mon Sep 17 00:00:00 2001 From: Vijay A Date: Sat, 14 Aug 2021 15:17:27 +0530 Subject: feat: Add buttons in the 'Advanced' section of preferences to allow the user to quickly open the Ferdi profile folder --- src/containers/settings/RecipesScreen.js | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'src/containers/settings') diff --git a/src/containers/settings/RecipesScreen.js b/src/containers/settings/RecipesScreen.js index 52bf31383..526e0a1a9 100644 --- a/src/containers/settings/RecipesScreen.js +++ b/src/containers/settings/RecipesScreen.js @@ -1,5 +1,4 @@ -import { shell } from 'electron'; -import { ensureDirSync, readJsonSync } from 'fs-extra'; +import { readJsonSync } from 'fs-extra'; import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { autorun } from 'mobx'; @@ -13,7 +12,7 @@ import UserStore from '../../stores/UserStore'; import RecipesDashboard from '../../components/settings/recipes/RecipesDashboard'; import ErrorBoundary from '../../components/util/ErrorBoundary'; import { CUSTOM_WEBSITE_RECIPE_ID, FRANZ_DEV_DOCS } from '../../config'; -import { asarRecipesPath, userDataRecipesPath } from '../../environment'; +import { asarRecipesPath, openPath, userDataRecipesPath } from '../../environment'; import { communityRecipesStore } from '../../features/communityRecipes'; import RecipePreview from '../../models/RecipePreview'; import AppStore from '../../stores/AppStore'; @@ -154,13 +153,8 @@ export default @inject('stores', 'actions') @observer class RecipesScreen extend serviceStatus={services.actionStatus} recipeFilter={filter} recipeDirectory={recipeDirectory} - openRecipeDirectory={async () => { - ensureDirSync(recipeDirectory); - shell.openExternal(`file://${recipeDirectory}`); - }} - openDevDocs={() => { - appActions.openExternalUrl({ url: FRANZ_DEV_DOCS }); - }} + openRecipeDirectory={() => openPath(recipeDirectory)} + openDevDocs={() => appActions.openExternalUrl({ url: FRANZ_DEV_DOCS })} /> ); -- cgit v1.2.3-54-g00ecf