Node logic when the device is not connected to the router

I noticed that if the node is not connected to the router or to the blynk server, the manual logic, for example, the lighting of a button led does not work. This is because the loop always runs blynk.run and tries to establish a wifi connection … To fix this on an esp8266 I have inserted this condition
void loop () {
if (WiFi.status ()! = WL_CONNECTED) {
} else {
Blynk.run ();
}