@@ -260,45 +260,12 @@ const AuthorQuestionsPage: FC<Props> = ({
260260 if ( assignmentId ) {
261261 loadVersions ( ) . catch ( console . error ) ;
262262 }
263- } , [ assignmentId , loadVersions ] ) ;
263+ } , [ assignmentId ] ) ;
264264
265265 useEffect ( ( ) => {
266- if ( checkedOutVersion && versions . length > 0 ) {
267- if ( assignmentId !== activeAssignmentId ) {
268- setActiveAssignmentId ( assignmentId ) ;
269- }
270-
271- const fetchCheckedOutVersion = async ( ) => {
272- try {
273- const { checkoutVersion } = useAuthorStore . getState ( ) ;
274- await checkoutVersion (
275- checkedOutVersion . id ,
276- checkedOutVersion . versionNumber ,
277- ) ;
278- } catch ( error ) {
279- console . error ( "Failed to fetch checked out version:" , error ) ;
280- }
281- } ;
282- void fetchCheckedOutVersion ( ) ;
283- return ;
284- }
285-
286266 if ( assignmentId !== activeAssignmentId ) {
287267 const fetchAssignment = async ( ) => {
288268 try {
289- const currentCheckedOutVersion =
290- useAuthorStore . getState ( ) . checkedOutVersion ;
291-
292- if ( currentCheckedOutVersion ) {
293- const { checkoutVersion } = useAuthorStore . getState ( ) ;
294- await checkoutVersion (
295- currentCheckedOutVersion . id ,
296- currentCheckedOutVersion . versionNumber ,
297- ) ;
298- setActiveAssignmentId ( assignmentId ) ;
299- return ;
300- }
301-
302269 const assignment = await getAssignment ( assignmentId ) ;
303270 if ( assignment ) {
304271 setActiveAssignmentId ( assignmentId ) ;
@@ -485,8 +452,6 @@ const AuthorQuestionsPage: FC<Props> = ({
485452 setName ,
486453 setQuestions ,
487454 setFocusedQuestionId ,
488- checkedOutVersion ,
489- versions ,
490455 ] ) ;
491456
492457 useEffect ( ( ) => {
0 commit comments