Add promise to ensure unit visibility is changed

Added Promise to wait until Edit button is visible/invisible after changing unit visibility.

@auraz @polesye @jzoldak