My understanding of A たとき B is that it is used when B happens after A; A るとき B is used when B happens before A. (Related question: What is the difference between ~たとき vs ~るとき)
However, my understanding fails me when I face たい sentences:
来月 日本へ (行く / 行った) 時、富士山を 見たいです。
My teacher explained that 行った needs to be used instead of 行く. Why this is the case? It seems to me that one would want to see Mt. Fuji before going to Japan. It would be weird to go to Japan first and suddenly want to go to Mt. Fuji...