A, hopfully, proper threading fix

The previous fix broke the checkout command as the PrepareCommand was not updating the global variable. This fix should actually be cleaner, as it will only update the value when the view changes.