Skip to content

Commit

Permalink
Fix bug + work in prod
Browse files Browse the repository at this point in the history
  • Loading branch information
haikyuu committed Apr 12, 2023
1 parent d375234 commit 14c2ad9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions blocks/scrimba-block.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import { useCallback, useEffect, useRef, useState } from "react";
import "./style.css";
import { Button, Text, Link } from "@primer/react";

const SCRIMBA_BASE_URL = import.meta?.env?.DEV
const isDev = import.meta?.url.includes("localhost:");
const SCRIMBA_BASE_URL = isDev
? "https://dev.scrimba.com:3000"
: "https://scrimba.com";
const SCRIMBA_URL = `${SCRIMBA_BASE_URL}/new/htmlblocks`;
Expand Down Expand Up @@ -53,7 +54,8 @@ export default function (props: FolderBlockProps) {
if (!tree && !all) {
return [{ ...context, type: "blob", content: props.content }];
}
return getFilesRecursive(context.path);
let path = !tree ? "/" : context.path || "/";
return getFilesRecursive(path);
},
[context.repo, context.owner, context.sha, files, tree, props.content]
);
Expand Down

0 comments on commit 14c2ad9

Please sign in to comment.