Remove duplicate site then 'installation failed'

Hello,

I guess this isn't a new question but here goes.

If I end up with two versions of the same site in my dashboard - http://www.mydomain.com and .mydomain.com and then I delete one version I may be then left with plugin icons that are still grey.

If I then try to install that plugin from the dashboard the installation fails because it was installed on the deleted version of the domain in the dashboard.

So the site is there and the plugin is already there.

How do I refresh and sync my dashboard after deleting duplication domains?

Thanks.