File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ import { useState, useEffect } from 'react';
1919let unsupported ;
2020
2121const useNetworkStatus = initialEffectiveConnectionType => {
22- if ( 'connection' in navigator && 'effectiveType' in navigator . connection ) {
22+ if ( typeof navigator !== 'undefined' && 'connection' in navigator && 'effectiveType' in navigator . connection ) {
2323 unsupported = false ;
2424 } else {
2525 unsupported = true ;
Original file line number Diff line number Diff line change 1717let unsupported ;
1818
1919const useSaveData = ( initialSaveDataStatus = null ) => {
20- if ( 'connection' in navigator && 'saveData' in navigator . connection ) {
20+ if ( typeof navigator !== 'undefined' && 'connection' in navigator && 'saveData' in navigator . connection ) {
2121 unsupported = false ;
2222 } else {
2323 unsupported = true ;
You can’t perform that action at this time.
0 commit comments