fix(ssr-navigator): resolve ReferenceError navigator is not defined during Next.js static prerendering in useNetworkStatus hook
This commit is contained in:
1 parent
eb6318ecc1
commit
dac41b14ee
2 files changed
+6
-2
No files matched your search
@@ -197,7 +197,7 @@ export default function ProductPage({ productSlug }: { productSlug: string }) {
|
||||
<div className="flex items-center gap-2">
|
||||
<button
|
||||
onClick={() => {
|
||||
if (navigator.clipboard) {
|
||||
if (typeof window !== 'undefined' && navigator.clipboard) {
|
||||
navigator.clipboard.writeText(window.location.href);
|
||||
toast.success("لینک مشخصات و دوز دارویی محصول کپی شد");
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user