Merge pull request #21597 from overleaf/ar-fix-error-assistant-error-in-e2e-tests

[web] Make sure aiErrorAssistant exists before using

GitOrigin-RevId: 31a4a6a2aa152aee6620c8e44e44dea3c6bf3b44
This commit is contained in:
Andrew Rumble 2024-11-05 15:32:09 +00:00 committed by Copybot
parent 80b3ad255d
commit 22d3e4bc13

View file

@ -105,7 +105,7 @@ export const EditorProvider: FC = ({ children }) => {
) )
const [premiumSuggestionResetDate, setPremiumSuggestionResetDate] = const [premiumSuggestionResetDate, setPremiumSuggestionResetDate] =
useState<Date>(() => { useState<Date>(() => {
return featureUsage?.aiErrorAssistant.resetDate return featureUsage?.aiErrorAssistant?.resetDate
? new Date(featureUsage.aiErrorAssistant.resetDate) ? new Date(featureUsage.aiErrorAssistant.resetDate)
: new Date() : new Date()
}) })