Media queries in js are inaccurate always. This is due to inconsistency amongst browser windows and scrollbars. This small discrepancy causes bigger issues when accuracy is number one priority for triggering certain functions.
Instead of looking for window width, trigger fn based on css media query breakpoint.
if ($('a.logo-link').width() == 200 ){
//is desktop
} //end if