Skip to content

Commit

Permalink
Fix multiple questions for new widgets
Browse files Browse the repository at this point in the history
  • Loading branch information
cayb0rg committed Dec 19, 2023
1 parent b586860 commit 933ca5f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/src-assets/creator-assets/directives.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -1980,6 +1980,8 @@ angular.module "Adventure"
# Initialize the node edit screen with the node's info. If info doesn't exist yet, init properties
if $scope.editedNode.question then $scope.question = $scope.editedNode.question
else $scope.question = null
if $scope.editedNode.questions then $scope.questions = $scope.editedNode.questions
else $scope.questions = []

# Reset size of question box
document.querySelector(".question-box").style.width = null;
Expand Down Expand Up @@ -2193,7 +2195,7 @@ angular.module "Adventure"
requiredItems: []
requiredVisits: if $scope.editedNode.questions.length > 0 then $scope.editedNode.questions[$scope.editedNode.questions.length - 1].requiredVisits + 1 else 0

# Add new answer to answers array
# Add new answer to questions array
$scope.editedNode.questions.push newQuestion

$scope.removeQuestion = () ->
Expand Down

0 comments on commit 933ca5f

Please sign in to comment.