Its really annoying to have to open a file in Teams and the click again on Open in Desktop App
Below is a workaround that works very well.
- When you are in teams right click the 3 dots next to General and click "open in sharepoint"
- When in Sharepoint online click on the gear next to your picture or initials (in the top right of the screen)
- Click on Library settings
- Select Advanced Settings in General Settings
- In "Opening Documents in the Browser" Change to Open in the client application
- Go back to the documents in Sharepoint online and copy and paste the entire web address
- Go Back to Teams
- Right Click Documents Library and select Remove
- Select the plus and select website
- Name it whatever you like
- Paste the document library web address you just copied
- Select Save
- It will now open the desktop app as default
Reference