Fix legend state when revert called - #782