Fix the create dialog on empty installs

This commit is contained in:
Kenn Jacobsen
2020-02-11 07:42:54 +01:00
committed by Sebastiaan Janssen
parent f4cd1c2f0c
commit 5e155a871c

View File

@@ -22,10 +22,14 @@ function contentCreateController($scope,
function initialize() {
$scope.loading = true;
$scope.allowedTypes = null;
$scope.countTypes = contentTypeResource.getCount;
var getAllowedTypes = contentTypeResource.getAllowedTypes($scope.currentNode.id).then(function (data) {
$scope.allowedTypes = iconHelper.formatContentTypeIcons(data);
if ($scope.allowedTypes.length === 0) {
contentTypeResource.getCount().then(function(count) {
$scope.countTypes = count;
});
}
});
var getCurrentUser = authResource.getCurrentUser().then(function (currentUser) {
if (currentUser.allowedSections.indexOf("settings") > -1) {