feat (ui): File picker for scheduling recipes default to recipe dir (#3611)
This commit is contained in:
@@ -6,6 +6,7 @@ import { Select } from '../ui/Select';
|
||||
import cronstrue from 'cronstrue';
|
||||
import * as yaml from 'yaml';
|
||||
import { Recipe, decodeRecipe } from '../../recipe';
|
||||
import { getStorageDirectory } from '../../recipe/recipeStorage';
|
||||
import ClockIcon from '../../assets/clock-icon.svg';
|
||||
|
||||
type FrequencyValue = 'once' | 'every' | 'daily' | 'weekly' | 'monthly';
|
||||
@@ -361,7 +362,9 @@ export const CreateScheduleModal: React.FC<CreateScheduleModalProps> = ({
|
||||
};
|
||||
|
||||
const handleBrowseFile = async () => {
|
||||
const filePath = await window.electron.selectFileOrDirectory();
|
||||
// Default to global recipes directory, but fallback to local if needed
|
||||
const defaultPath = getStorageDirectory(true);
|
||||
const filePath = await window.electron.selectFileOrDirectory(defaultPath);
|
||||
if (filePath) {
|
||||
if (filePath.endsWith('.yaml') || filePath.endsWith('.yml')) {
|
||||
setRecipeSourcePath(filePath);
|
||||
|
||||
Reference in New Issue
Block a user