Keep environment when switching to offline and show alerts message for sync