stefanjudis/netlify-menubar

Stop polling the netlify API when offline was detected

stefanjudis opened this issue · 1 comments

Currently the App keeps polling in the predefined interval no matter if the user is online or offline.

The logic could be adjusted a little bit to stop polling the connection object fires an offline event and could start again when the user comes online again.

connection.on('status-changed', conn => {
    if (conn.isOnline) {
        // start polling again
    } else {
        // stop polling
    }
});

The polling and retry logic can be found here.

Fixed with #10