apollo-link-token-refresh icon indicating copy to clipboard operation
apollo-link-token-refresh copied to clipboard

Check if client is online in react native?

Open luluhoc opened this issue 1 year ago • 1 comments

if (
         !navigator.onLine ||
         (error instanceof TypeError &&
           error.message === "Network request failed")
       ) {
         console.log("Offline -> do nothing 🍵")
       } else {
         console.log("Online -> log out 👋")

         // your custom action here
         user.logout();
      }       

this doesn't work with react native.

luluhoc avatar Oct 13 '22 13:10 luluhoc