From: David ‘Bombe’ Roden Date: Sun, 9 Nov 2014 10:55:58 +0000 (+0100) Subject: Use “isLoaded” method to check for not-yet loaded bookmarks. X-Git-Tag: 0.9-rc1^2~3^2~29 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=e1f20f0866307ea8a4e54785df1db3c25f660ef8;p=Sone.git Use “isLoaded” method to check for not-yet loaded bookmarks. --- diff --git a/src/main/java/net/pterodactylus/sone/web/BookmarksPage.java b/src/main/java/net/pterodactylus/sone/web/BookmarksPage.java index 373ff18..0f53572 100644 --- a/src/main/java/net/pterodactylus/sone/web/BookmarksPage.java +++ b/src/main/java/net/pterodactylus/sone/web/BookmarksPage.java @@ -68,7 +68,7 @@ public class BookmarksPage extends SoneTemplatePage { @Override public boolean apply(Post post) { - return post.getSone() != null; + return post.isLoaded(); } }); List sortedPosts = new ArrayList(loadedPosts); diff --git a/src/main/java/net/pterodactylus/sone/web/UnbookmarkPage.java b/src/main/java/net/pterodactylus/sone/web/UnbookmarkPage.java index 7dfe301..72ff2fc 100644 --- a/src/main/java/net/pterodactylus/sone/web/UnbookmarkPage.java +++ b/src/main/java/net/pterodactylus/sone/web/UnbookmarkPage.java @@ -67,7 +67,7 @@ public class UnbookmarkPage extends SoneTemplatePage { if (id.equals("allNotLoaded")) { Set posts = webInterface.getCore().getBookmarkedPosts(); for (Post post : posts) { - if (post.getSone() == null) { + if (post.isLoaded()) { webInterface.getCore().unbookmarkPost(post); } }