fix: multiple issues
1. Script warning in layout.tsx - Use Next.js Script component instead of plain <script> 2. QUOTA_EXCEEDED bug for chart suggestions - Add 'suggest_charts' to VALID_FEATURES - Add 'suggest_charts' to TIER_LIMITS for all tiers - Fix route to use 'suggest_charts' instead of invalid 'ai' feature This fixes the issue where users with valid credit were getting QUOTA_EXCEEDED errors because 'ai' was not a valid feature name. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -44,7 +44,7 @@ export async function POST(req: Request) {
|
||||
const sysConfigEarly = await getSystemConfig()
|
||||
const { usedByok: willUseByok } = await willUseByokForLane('suggest-charts', sysConfigEarly, userId)
|
||||
if (!willUseByok) {
|
||||
await checkEntitlementOrThrow(userId, 'ai')
|
||||
await checkEntitlementOrThrow(userId, 'suggest_charts')
|
||||
}
|
||||
} catch (err) {
|
||||
if (err instanceof QuotaExceededError) {
|
||||
@@ -169,7 +169,7 @@ Response format (JSON):
|
||||
)
|
||||
|
||||
// Track usage
|
||||
await trackFeatureUsage(userId, 'ai', 'suggest-charts', 1)
|
||||
await trackFeatureUsage(userId, 'suggest_charts', 'suggest-charts', 1)
|
||||
|
||||
return Response.json(parsed satisfies SuggestChartsResponse)
|
||||
|
||||
|
||||
@@ -112,7 +112,9 @@ export default async function RootLayout({
|
||||
>
|
||||
<head />
|
||||
<body className={`${inter.className} ${inter.variable} ${manrope.variable} ${playfair.variable} ${jetbrainsMono.variable}`}>
|
||||
<script
|
||||
<Script
|
||||
id="theme-init"
|
||||
strategy="beforeInteractive"
|
||||
dangerouslySetInnerHTML={{ __html: getThemeScript(userSettings.theme, userSettings.accentColor) }}
|
||||
/>
|
||||
<Script
|
||||
|
||||
Reference in New Issue
Block a user