Skip to content

Commit

Permalink
Update PDF.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
LarsFlem authored Oct 23, 2024
1 parent 25e1e78 commit 988bc39
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/components/PDF.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@ const PdfViewer: React.FC = () => {
const objectRef = useRef<HTMLObjectElement>(null); // Ref for object

useEffect(() => {
const userAgent = navigator.userAgent || navigator.vendor || window.opera;
const userAgent = navigator.userAgent || navigator.vendor;

// Detect iOS (iPhone/iPad)
if (/iPad|iPhone|iPod/.test(userAgent) && !(window as any).MSStream) {
setIsIOS(true);
}
// Detect iOS (iPhone/iPad) - updated condition to not use window.opera
const isIOSDevice = /iPad|iPhone|iPod/.test(userAgent);
setIsIOS(isIOSDevice);
}, []);

return (
Expand Down

0 comments on commit 988bc39

Please sign in to comment.