Skip to content

Commit

Permalink
Fix version display issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
brysonjbest committed Nov 28, 2024
1 parent 4adc2c2 commit 8eb418d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/components/VersionBar/VersionBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ interface VersionBarProps {

export default function VersionBar({
ruleInfo,
version = process.env.NEXT_PUBLIC_IN_PRODUCTION ? RULE_VERSION.inProduction : RULE_VERSION.inDev,
version = process.env.NEXT_PUBLIC_IN_PRODUCTION === "true" ? RULE_VERSION.inProduction : RULE_VERSION.inDev,
}: VersionBarProps) {
const versionColor = getVersionColor(version);

Expand Down
9 changes: 4 additions & 5 deletions app/rule/[ruleId]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,10 @@ export async function generateMetadata({ params, searchParams }: Props): Promise
}

export default async function Rule({ params: { ruleId }, searchParams }: Props) {
const version = searchParams.version?.trim()
? searchParams.version
: process.env.NEXT_PUBLIC_IN_PRODUCTION
? RULE_VERSION.inProduction
: RULE_VERSION.inDev;
const defaultVersion =
process.env.NEXT_PUBLIC_IN_PRODUCTION === "true" ? RULE_VERSION.inProduction : RULE_VERSION.inDev;

const version = searchParams.version?.trim() || defaultVersion;

const oAuthRequired = version === RULE_VERSION.draft; // only require oauth if editing a draft
// Ensure user is first logged into github so they can save what they edit
Expand Down

0 comments on commit 8eb418d

Please sign in to comment.