Skip to content

Commit

Permalink
Revert "change to use only youtube"
Browse files Browse the repository at this point in the history
This reverts commit ca097bd.
  • Loading branch information
okrayum committed Sep 28, 2024
1 parent c6821de commit e4a911d
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 62 deletions.
120 changes: 60 additions & 60 deletions client/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ function App() {

const bgColor = useColorModeValue("white", "#313338");



useEffect(() => {
if (isToastSuccess.toLowerCase().includes("error")) {
toast.error(isToastSuccess, {
Expand All @@ -61,7 +63,7 @@ function App() {
}
}, [isToastSuccess]);

if (isLoading) {
if (isLoading) {
return <Loading isLoading={isLoading} />;
}

Expand All @@ -76,65 +78,63 @@ function App() {
className="transition-all duration-500 ease-in-out"
>
<Navbar />
<Box as="main" flex="1" p={4}>
<Routes>
<Route
path="/"
element={
!isAuthenticated ? <Landing /> : <Navigate to="/home" />
}
/>
<Route
path="/home"
element={isAuthenticated ? <Home /> : <Navigate to="/" />}
/>
<Route
path="/templates"
element={isAuthenticated ? <Templates /> : <Navigate to="/" />}
/>
<Route
path="/new"
element={isAuthenticated ? <NewBoard /> : <Navigate to="/" />}
/>
<Route
path="/generate"
element={isAuthenticated ? <Generate /> : <Navigate to="/" />}
/>
<Route
path="/boards/:id"
element={isAuthenticated ? <Board /> : <Navigate to="/" />}
/>
<Route
path="/account"
element={isAuthenticated ? <Account /> : <Navigate to="/" />}
/>
<Route
path="/uploads"
element={
isAuthenticated ? <UserTemplates /> : <Navigate to="/" />
}
/>
<Route
path="/admin_dashboard"
element={isAdmin ? <AdminDashboard /> : <Navigate to="/" />}
/>
<Route
path="/callback"
element={isAuthenticated ? <Home /> : <Navigate to="/home" />}
/>
<Route
path="*"
element={
isAuthenticated ? (
<ErrorPage />
) : (
<Navigate to="/home" replace />
)
}
/>
</Routes>
</Box>
<Footer />
<Box as="main" flex="1" p={4}>
<Routes>
<Route
path="/"
element={!isAuthenticated ? <Landing /> : <Navigate to="/home" />}
/>
<Route
path="/home"
element={isAuthenticated ? <Home /> : <Navigate to="/" />}
/>
<Route
path="/templates"
element={isAuthenticated ? <Templates /> : <Navigate to="/" />}
/>
<Route
path="/new"
element={isAuthenticated ? <NewBoard /> : <Navigate to="/" />}
/>
<Route
path="/generate"
element={isAuthenticated ? <Generate /> : <Navigate to="/" />}
/>
<Route
path="/boards/:id"
element={isAuthenticated ? <Board /> : <Navigate to="/" />}
/>
<Route
path="/account"
element={isAuthenticated ? <Account /> : <Navigate to="/" />}
/>
<Route
path="/uploads"
element={
isAuthenticated ? <UserTemplates /> : <Navigate to="/" />
}
/>
<Route
path="/admin_dashboard"
element={isAdmin ? <AdminDashboard /> : <Navigate to="/" />}
/>
<Route
path="/callback"
element={isAuthenticated ? <Home /> : <Navigate to="/home" />}
/>
<Route
path="*"
element={
isAuthenticated ? (
<ErrorPage />
) : (
<Navigate to="/home" replace />
)
}
/>
</Routes>
</Box>
<Footer />
</Flex>
</Router>
{/* Global ToastContainer */}
Expand Down
4 changes: 2 additions & 2 deletions server/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ def create_subtopics():
Instead, rephrase the text to exclude these characters."""
else:

prompt = f"""Please break down the topic '{text}' into exactly 3 distinct subtopics in order to give a '{complexity}' of the topic.
prompt = f"""Please break down the topic '{text}' into '{num_subtopics}' distinct subtopics in order to give a '{complexity}' of the topic.
Each subtopic should include a name and a short summary.
The subtopic name should be a few words long and be specific to the context of what the topic is about. Avoid generic names.
The goal for these subtopics is to provide a comprehensive overview of the main topic.
Expand Down Expand Up @@ -816,7 +816,7 @@ def get_links():
if format_type == 'video':
resource = get_youtube_tutorial(topic)
elif format_type == 'article':
resource = get_youtube_tutorial(topic)
resource = get_bing_article(topic)
else:
resource = {'topic': topic, 'error': 'Invalid format type'}

Expand Down

0 comments on commit e4a911d

Please sign in to comment.