Merge branch 'MDL-65657-master' of https://github.com/ryanwyllie/moodle
authorJake Dallimore <jake@moodle.com>
Mon, 27 May 2019 05:22:45 +0000 (13:22 +0800)
committerJake Dallimore <jake@moodle.com>
Mon, 27 May 2019 05:22:45 +0000 (13:22 +0800)
1  2 
message/amd/build/message_drawer_view_conversation.min.js
message/amd/src/message_drawer_view_conversation.js

@@@ -1513,18 -1494,22 +1512,28 @@@ function
       * @param  {Object} body Conversation body container element.
       * @param  {Number|null} conversationId The conversation id.
       * @param  {Object} loggedInUserProfile The logged in user's profile.
 -     * @return {Promise} Renderer promise.
       */
      var resetState = function(body, conversationId, loggedInUserProfile) {
 +        // Reset all of the states back to the beginning if we're loading a new
 +        // conversation.
 +        isResetting = true;
 +        isRendering = false;
 +        renderBuffer = [];
 +        isSendingMessage = false;
 +
          var loggedInUserId = loggedInUserProfile.id;
          var midnight = parseInt(body.attr('data-midnight'), 10);
-         var initialState = StateManager.buildInitialState(midnight, loggedInUserId, conversationId);
+         var messagePollMin = parseInt(body.attr('data-message-poll-min'), 10);
+         var messagePollMax = parseInt(body.attr('data-message-poll-max'), 10);
+         var messagePollAfterMax = parseInt(body.attr('data-message-poll-after-max'), 10);
+         var initialState = StateManager.buildInitialState(
+             midnight,
+             loggedInUserId,
+             conversationId,
+             messagePollMin,
+             messagePollMax,
+             messagePollAfterMax
+         );
  
          if (!viewState) {
              viewState = initialState;