Need to add Name back to customized chat

Hello All,

About 5 months ago I tried, with this communities help, to make a thing. It was quite Frankenstein and I need some help.
Please note that we have hours of operation set to hide the chat icon.


In the process of making this, I removed the chat’s ability to ask for a name when a client first opens the chat.

I have created a code pen for my work:

Original unmodified:

I have broken it but can’t get the Name request back into the process. I am a poor JS coder so I am struggling. Can anyone throw some advice on this my way?

Thank you!


Morning, is anyone able to give me some direction? I don’t want to spam the board but I do want to try and get this fixed. Thank you!