This is the event handler that is listening for messages and in the data of the message is toggle-sidebar then it will open or close the sidebar