Fix bug where switching tab mixes up or forgets the links to be shown in the popup.