Skip to content

Commit

Permalink
chore: formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
LatentDream committed Apr 22, 2024
1 parent fbdfad9 commit 932bf87
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
12 changes: 7 additions & 5 deletions src/renderer/hooks/useTestSequencerProject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,15 @@ export const useImportAllSequencesInFolder = () => {
const manager = usePrepareStateManager();
const { isAdmin } = useWithPermission();

const handleImport = async (path: string, relative: boolean=false) => {
const handleImport = async (path: string, relative: boolean = false) => {
async function importSequences(): Promise<Result<void, Error>> {
// Confirmation if admin
if (!isAdmin()) {
return err(Error("Admin only, Connect to Flojoy Cloud and select a Test Profile"));
return err(
Error(
"Admin only, Connect to Flojoy Cloud and select a Test Profile",
),
);
}

// Find .tjoy files from the profile
Expand All @@ -136,9 +140,7 @@ export const useImportAllSequencesInFolder = () => {
relative,
);
if (result === undefined) {
return err(
Error(`Failed to find the directory ${path}`),
);
return err(Error(`Failed to find the directory ${path}`));
}
if (!result || result.length === 0) {
return err(Error("No .tjoy file found in the selected directory"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,12 @@ export function DesignBar() {
onClick={() => setIsGalleryOpen(true)}
data-testid="app-gallery-btn"
>
<LayoutGrid size={16} className="mr-2 stroke-muted-foreground" />
<LayoutGrid
size={16}
className="mr-2 stroke-muted-foreground"
/>
Import Example
</DropdownMenuItem>

</DropdownMenuContent>
</DropdownMenu>
<SequencerGalleryModal
Expand Down Expand Up @@ -275,10 +277,10 @@ export const getGlobalStatus = (
const highestCycle =
cycleRuns.length > 0
? cycleRuns
.map((el) => getGlobalStatus([], el, []))
.reduce((prev, curr) =>
priority[prev] > priority[curr] ? prev : curr,
)
.map((el) => getGlobalStatus([], el, []))
.reduce((prev, curr) =>
priority[prev] > priority[curr] ? prev : curr,
)
: "pending";

if (sequences.length === 0 && data.length === 0) return highestCycle;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export const SequencerGalleryModal = ({
isGalleryOpen,
setIsGalleryOpen,
}: AppGalleryModalProps) => {

const importSequence = useImportAllSequencesInFolder();

const handleSequenceLoad = (relativePath: string) => {
Expand Down

0 comments on commit 932bf87

Please sign in to comment.