Fix state of api widget on reopen.