I’ve added two lines of code in the article after some feedback I received,
See line 8-9 here. You can use this to recognize multiple intents only when the flow stack is empty. Thanks for the idea, @Lina !