Corrected entry: If Thor knew that Thanos would be waiting for the stones on Titan he should have gone there, instead of somehow knowing to head straight to Wakanda.
Correction: The movie never says that Thor knew that Thanos was on Titan. He knew from the first scene in the film that Thanos sent the Black Order to look for the two Stones that were on Earth (one of which ended up going to Titan with Doctor Strange). He simply used his new powers to summon the Bifrost to survey Earth and located his friends and the Mind Stone in Wakanda and teleported there.
Continuity mistake: Thanos' ship is near the ground in New York but seconds later when Peter senses it, the ship is higher, at building level. (00:18:10)
Suggested correction: The two events aren't happening in real time. It's clear Peter sees the ship before it gets close to the ground.
Correction: Thor didn't know Thanos went to Titan. He correctly predicted that he would head to Knowhere, after which he would likely go after the 2 stones on Earth.
Thor heard from Thanos that we will be go to Titan inside the ship or at least he should go to Knowwhere not to the earth.
Thor's new hammer gives him the ability to summon the Bifrost, which means he has to survey his intended destination before creating the portal to transport. He very well could have surveyed both Knowhere and Titan (assuming he even knows where Titan is) before settling on Wakanda, but that would have both wasted screen time and diminished the impact for the audience of him arriving in Wakanda to help the other heroes. The movie even shows Thanos arriving on Titan after Thor already arrived in Wakanda, so we can surmise that Thor didn't know where Thanos was located and settled on joining the battle on Earth with the hope that Thanos would eventually turn up there.
Phaneron ★