Better state handling in frontend repo switching