diff --git a/dashboard-ui/itemdetails.html b/dashboard-ui/itemdetails.html index e41b55c080..0d668fb1c6 100644 --- a/dashboard-ui/itemdetails.html +++ b/dashboard-ui/itemdetails.html @@ -253,7 +253,7 @@
diff --git a/dashboard-ui/scripts/homelatest.js b/dashboard-ui/scripts/homelatest.js index 806287fec6..35576025c8 100644 --- a/dashboard-ui/scripts/homelatest.js +++ b/dashboard-ui/scripts/homelatest.js @@ -1,6 +1,8 @@ (function ($, document) { - function loadSections(page, userId) { + function loadSections(page, user) { + + var userId = user.Id; var i, length; var sectionCount = 3; @@ -21,7 +23,7 @@ var latestMediElem = $('.section0', page); - Sections.loadRecentlyAdded(latestMediElem, userId, context).done(function () { + Sections.loadRecentlyAdded(latestMediElem, user, context).done(function () { $('h1', latestMediElem).addClass('firstListHeader'); }); @@ -33,9 +35,9 @@ var page = this; - var userId = Dashboard.getCurrentUserId(); - - loadSections(page, userId); + Dashboard.getCurrentUser().done(function (user) { + loadSections(page, user); + }); }); diff --git a/dashboard-ui/scripts/indexpage.js b/dashboard-ui/scripts/indexpage.js index fe660f283b..4b37f43ac5 100644 --- a/dashboard-ui/scripts/indexpage.js +++ b/dashboard-ui/scripts/indexpage.js @@ -119,7 +119,7 @@ }); } - function loadRecentlyAdded(elem, userId, context) { + function loadRecentlyAdded(elem, user, context) { var options = { @@ -130,14 +130,18 @@ EnableImageTypes: "Primary,Backdrop,Banner,Thumb" }; - return ApiClient.getJSON(ApiClient.getUrl('Users/' + userId + '/Items/Latest', options)).done(function (items) { + return ApiClient.getJSON(ApiClient.getUrl('Users/' + user.Id + '/Items/Latest', options)).done(function (items) { var html = ''; if (items.length) { html += '