Apply the logic that determines the current workspace dynamically