Hi Duncan, a bug in intellij prevents me from offering a proper fix, however I’ll try to write the fix blindly and please try it out. In the MyUI file, add this at line 34:
private lateinit var welcomeMenuButton: MenuButton
It is important that you change the state of the Vaadin components only with the Vaadin UI lock held: either from Vaadin listeners, or from UI.init(), or by using ui.access {} block. Otherwise, you will not see the effect from your changes, and silent internal corruption caused by multithreaded concurrent modification may occur, which may cause random bugs. So please be careful when modifying Vaadin components from a background thread. Just remember that from your thread you need to call ui.access {} and modify Vaadin components in that access block and you will be safe.