Skip to content

Commit

Permalink
corrected show message error
Browse files Browse the repository at this point in the history
  • Loading branch information
C-Anirudh committed Apr 10, 2019
1 parent e7f4246 commit 6b85163
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
13 changes: 7 additions & 6 deletions view/app-jarvis.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,27 +132,28 @@ app.controller('MainController', function($scope,$location,$rootScope,$http) {
messageObj.result = result;
$scope.messageStack.push(messageObj);
$scope.showLoading = false;
} else if ((status === 'success' || status) && !show) {
} else if ((status === 'success' || status) && message === 'Enter Reminder details : ') {
messageObj.sender = 'jarvis-bot';
messageObj.time = String(new Date().getHours() + ':' + new Date().getMinutes());
messageObj.length = message.length;
messageObj.message = message;
$scope.messageStack.push(messageObj);
$scope.showLoading = false;
} else if ((status === 'success' || status) && message === 'Enter Reminder details : ') {
} else if ((status === 'success' || status) && message === 'Here are your reminders : ') {
console.log("In show reminder");
messageObj.sender = 'jarvis-bot';
messageObj.time = String(new Date().getHours() + ':' + new Date().getMinutes());
messageObj.length = message.length;
messageObj.message = message;
messageObj.result = result;
$scope.messageStack.push(messageObj);
} else if ((status === 'success' || status) && message === 'Here are your reminders : ') {
console.log(messageObj);
} else if ((status === 'success' || status) && !show) {
messageObj.sender = 'jarvis-bot';
messageObj.time = String(new Date().getHours() + ':' + new Date().getMinutes());
messageObj.length = message.length;
messageObj.message = message;
messageObj.result = result;
$scope.messageStack.push(messageObj);
console.log(messageObj);
$scope.showLoading = false;
} else if (show) {
messageObj.sender = 'jarvis-bot';
messageObj.time = String(new Date().getHours() + ':' + new Date().getMinutes());
Expand Down
3 changes: 2 additions & 1 deletion view/components/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@ <h4 class="head-query-data">{{$index + 1}}. {{objectQuery.head}}</h4>
<div data-ng-repeat="objectQuery in message.result" id="queried-info">
<h4 class="head-query-data">{{objectQuery.id}}. {{objectQuery.title}}</h4>
<p>{{objectQuery.description}}</p>
<p>{{objectQuery.time}}</p>
<br/>
<p><b>Due: </b>{{objectQuery.time}}</p>
</div>
</div>
</div>
Expand Down

0 comments on commit 6b85163

Please sign in to comment.