📜 refactor: Optimize Longer Message Thread Performance (#3610)

This commit is contained in:
Danny Avila 2024-08-11 06:08:08 -04:00 committed by GitHub
parent cf69b7ef85
commit 02847af580
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 59 additions and 280 deletions

View file

@ -1,4 +1,4 @@
export default function validateIframe(content: string): string | boolean | null {
export default function validateIframe(content: string): boolean {
const hasValidIframe =
content.includes('<iframe role="presentation" style="') &&
content.includes('src="https://www.bing.com/images/create');
@ -38,5 +38,7 @@ export default function validateIframe(content: string): string | boolean | null
const role = iframe.getAttribute('role');
const src = iframe.getAttribute('src');
return role === 'presentation' && src && src.startsWith('https://www.bing.com/images/create');
return (
role === 'presentation' && src != null && src.startsWith('https://www.bing.com/images/create')
);
}