Merge pull request #1 from darmali89898n/deepsource-autofix-848d6758

refactor: convert logical operator to optional chainining
pull/527/head
Mohan Sharma 2024-01-01 17:20:32 +06:00 committed by GitHub
commit 115925b42b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -56,7 +56,7 @@
return result; return result;
function _iterateSubItems(currentItem) { function _iterateSubItems(currentItem) {
currentItem.subMenu && currentItem.subMenu.forEach(function(subItem) { currentItem.subMenu?.forEach(function(subItem) {
subItem.stateRef && result.push(subItem.stateRef); subItem.stateRef && result.push(subItem.stateRef);
_iterateSubItems(subItem); _iterateSubItems(subItem);
}); });

View File

@ -57,7 +57,7 @@
function BaSidebarTogglingItemCtrl($scope, $element, $attrs, $state, baSidebarService) { function BaSidebarTogglingItemCtrl($scope, $element, $attrs, $state, baSidebarService) {
var vm = this; var vm = this;
var menuItem = vm.$$menuItem = $scope.$eval($attrs.baSidebarTogglingItem); var menuItem = vm.$$menuItem = $scope.$eval($attrs.baSidebarTogglingItem);
if (menuItem && menuItem.subMenu && menuItem.subMenu.length) { if (menuItem?.subMenu && menuItem.subMenu.length) {
vm.$$expandSubmenu = function() { console.warn('$$expandMenu should be overwritten by baUiSrefTogglingSubmenu') }; vm.$$expandSubmenu = function() { console.warn('$$expandMenu should be overwritten by baUiSrefTogglingSubmenu') };
vm.$$collapseSubmenu = function() { console.warn('$$collapseSubmenu should be overwritten by baUiSrefTogglingSubmenu') }; vm.$$collapseSubmenu = function() { console.warn('$$collapseSubmenu should be overwritten by baUiSrefTogglingSubmenu') };

View File

@ -38,7 +38,7 @@
} }
function submit() { function submit() {
$scope.form && $scope.form.$setSubmitted(true); $scope.form?.$setSubmitted(true);
} }
function isComplete() { function isComplete() {