Header Hide/show error on mobile burger Menu

Hi,

I’m having an issue with my header on the mobile interface. I have 2 headers, one that appears on load and the other that appears when you scroll down. The problem is, when you open the mobile burger menu, the 1st header starts to appear again. Does anyone know how I can resolve this? I have attached some screen shots below of the problem.

The code I’m using for the header is as follows

$w.onReady(() => {

	let headerSize = 75; // pixels

	let checkInterval = 250; // milliseconds

	setInterval(() => {

		wixWindow.getBoundingRect().then((windowRectInfo) => {

			if (windowRectInfo.scroll.y > headerSize) {

				$w('#purpleHeader').hide(); // name of top header strip

				console.log("Hide top header");

			} else {

				$w('#purpleHeader').show(); // name of top header strip

				console.log("Show top header");

			}

		});

	}, checkInterval);

});