Question in Spoiler tag below

>!When she legitimised Gendry, Daenerys had not won the iron throne. She died before her coronation and Gendry was at the high council before Bran was crowned king. How was Gendry able to become Lord of Storm's end?

Thanks