dannycranmer commented on a change in pull request #4092:
URL: https://github.com/apache/zeppelin/pull/4092#discussion_r612252990



##########
File path: zeppelin-web/src/app/notebook/notebook.controller.js
##########
@@ -539,11 +539,23 @@ function NotebookCtrl($scope, $route, $routeParams, 
$location, $rootScope,
   $scope.updateNoteName = function(newName) {
     const trimmedNewName = newName.trim();
     if (trimmedNewName.length > 0 && $scope.note.name !== trimmedNewName) {
+      $scope.note.oldName = $scope.note.name;
       $scope.note.name = trimmedNewName;
       websocketMsgSrv.renameNote($scope.note.id, $scope.note.name, true);
     }
   };
 
+  $scope.$on('setNoteMenu', function(event, notes) {
+    $scope.note.oldName = undefined;
+  });
+
+  $scope.$on('errorInfo', function(event, notes) {
+    if ($scope.note.oldName !== undefined) {
+      $scope.note.name = $scope.note.oldName;
+      $scope.note.oldName = undefined;
+    }
+  });

Review comment:
       I went with a combined approach:
   - Define an explicit exception for this error
   - Push a note update message to refresh stale UI




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to