Two readings, two different words. This is the time word, zhèngdāng: 正当 plus a clause means 'just when'. With a fourth tone on the second syllable, 正当 is an adjective meaning legitimate or proper, as in 正当防卫, justifiable self-defense.
usage
This reading heads a time clause and is normally closed with 的时候, which makes it written narrative rather than conversation. It also stands before a stage of life, as in 正当壮年, in one's prime.