It might be cleaner to have the action take place in the view you are navigating to, using .onAppear?
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: