diff --git a/erpnext/public/js/hub/pages/favourites.js b/erpnext/public/js/hub/pages/favourites.js
index 6c2fd655807..6f2c67c01ee 100644
--- a/erpnext/public/js/hub/pages/favourites.js
+++ b/erpnext/public/js/hub/pages/favourites.js
@@ -32,11 +32,20 @@ erpnext.hub.Favourites = class Favourites extends SubPage {
}
render(items) {
- this.$wrapper.find('.hub-card-container').empty();
+ this.$wrapper.find('.hub-items-container').empty();
const html = get_item_card_container_html(items, __('Favourites'));
- this.$wrapper.append(html);
-
+ this.$wrapper.html(html);
this.$wrapper.find('.hub-card').addClass('closable');
+
+ if (!items.length) {
+ this.render_empty_state();
+ }
+ }
+
+ render_empty_state() {
+ this.$wrapper.find('.hub-items-container').append(`
+
${__("You don't have any favourites yet.")}
+ `)
}
on_item_remove(hub_item_code, $hub_card = '') {
diff --git a/erpnext/public/js/hub/pages/search.js b/erpnext/public/js/hub/pages/search.js
index f3dd6fb0c50..1cdacb6db6e 100644
--- a/erpnext/public/js/hub/pages/search.js
+++ b/erpnext/public/js/hub/pages/search.js
@@ -27,8 +27,13 @@ erpnext.hub.SearchPage = class SearchPage extends SubPage {
}
render(items) {
- this.$wrapper.find('.hub-card-container').remove();
- const title = this.keyword ? __('Search results for "{0}"', [this.keyword]) : '';
+ this.$wrapper.find('.hub-items-container').remove();
+ const title = !items.length
+ ? __('No results found')
+ : this.keyword
+ ? __('Search results for "{0}"', [this.keyword])
+ : '';
+
const html = get_item_card_container_html(items, title);
this.$wrapper.append(html);
}