Yes Hitler's overall goal was to invade and beat the Soviet Union, but he also did not want to get into a two front war since he was well aware that is why Germany lost in WW1. Hitler was always going to make an attempt to invade the Soviet Union but the main reason he decided to do it in 1941, before beating the British was his belief that the only reason the British were holding out and not suing for peace was because the British were holding out for/expecting the Soviets to join the war on their side. Of course this was false but Hitler convinced himself of that, and decided an invasion as soon as possible was necessary.
Had the British sued for peace in 1940 then Hitler would have likely taken more time to get the preparations for the invasion of the Soviet Union right, or he could have turned his attention on Sweden for a little while. Either way though, without the British in the war the Germans would have had a much greater chance of beating the Soviet Union.