function refresh() { console.log(global); $('#favorites').html(""); // List of bottles if (global == null || (global.params != null && Object.keys(global.params).length == 0) || (global.params && global.params.page)) { app.GetRum().GetBottle().ListFavorites().then(function(res) { if (res.result == 200) { var list = []; for (var i = 0; i < res.favorites.length; i++) { list[i] = res.favorites[i].bottle_id; } app.GetRum().GetBottle().ListBottles(list).then(function(res) { if (res.result == 200) { var html = ""; html += "