diff --git a/app/assets/javascripts/favorites.js b/app/assets/javascripts/favorites.js index 4a46a8bf2..a3d59af7b 100644 --- a/app/assets/javascripts/favorites.js +++ b/app/assets/javascripts/favorites.js @@ -8,7 +8,6 @@ } Danbooru.Favorite.hide_or_show_add_to_favorites_link = function() { - var favorites = Danbooru.meta("favorites"); var current_user_id = Danbooru.meta("current-user-id"); if (current_user_id == "") { $("#add-to-favorites").hide(); @@ -17,8 +16,7 @@ $("#remove-fav-button").hide(); return; } - var regexp = new RegExp("\\bfav:" + current_user_id + "\\b"); - if ((favorites != undefined) && (favorites.match(regexp))) { + if ($("#image-container").length && $("#image-container").data("is-favorited") == true) { $("#add-to-favorites").hide(); $("#add-fav-button").hide(); } else {