I reversed the `if-else` parts for readability `if (!isOnline) -> if (isOnline)`