Skip to content

Commit

Permalink
Merge pull request #2496 from Agenta-AI/hot-fix/handle-app_type-being…
Browse files Browse the repository at this point in the history
…-null

[Hot Fix]: Improve handling of app_type
  • Loading branch information
ardaerzin authored Feb 19, 2025
2 parents deeb229 + 67ee1c5 commit fc9269f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion agenta-web/src/components/Playground/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const PlaygroundRouter = () => {
</div>
)
} else if (!!app) {
if (app.app_type?.includes(" (old)") || app.app_type === "custom") {
if (!app.app_type || app.app_type.includes(" (old)") || app.app_type === "custom") {
return <OldPlayground />
} else {
if (!router.query.playground) {
Expand Down
3 changes: 2 additions & 1 deletion agenta-web/src/lib/hooks/useVariants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import useStatelessVariants from "./useStatelessVariant"
export const useVariants = (app) =>
!app
? () => {}
: app.app_type.includes("old") || app.app_type.includes("custom")
: !app.app_type ||
(!!app.app_type && (app.app_type.includes("old") || app.app_type.includes("custom")))
? useLegacyVariants
: useStatelessVariants

0 comments on commit fc9269f

Please sign in to comment.