ganahrhr пре 2 година
родитељ
комит
1ce2ff2c62
1 измењених фајлова са 7 додато и 2 уклоњено
  1. 7 2
      Pages/ModalSurvey.razor

+ 7 - 2
Pages/ModalSurvey.razor

@@ -77,8 +77,13 @@
 
         Console.WriteLine($"AnswerID: {_survey.SurveyItems[_currentQuestionID].AnswerID}.");
 
-        _currentQuestionPosition++;
-        _currentQuestionID = _survey.SurveyItemsSorted.FirstOrDefault(i => i.Value.Position == _currentQuestionPosition).Key;
+        if (_currentQuestionPosition < _survey.SurveyItems.Count)
+        {
+            _currentQuestionPosition++;
+            _currentQuestionID = _survey.SurveyItemsSorted.FirstOrDefault(i => i.Value.Position == _currentQuestionPosition).Key;
+        }
+        else
+            Close();
     }
 
     string PositionToLetter(int position)