Skip to content

Commit

Permalink
Merge pull request #109 from Suwayomi/auth-bugfix
Browse files Browse the repository at this point in the history
Fixing AniListView authentication bug
  • Loading branch information
aless2003 authored Apr 9, 2024
2 parents 88f0b64 + 00d5fa9 commit 3d673f2
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ plugins {
}

group = 'online.hatsunemiku'
version = '1.6.0'
version = '1.6.1'
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,9 @@
</screenshot>
</screenshots>
<releases>
<release version="1.6.0" date="2024-04-08">
<release version="1.6.1" date="2024-04-09">
<description>
<p>VaadinUI now uses Suwayomi's authentication System. Enables MyAnimeList authentication.</p>
<p>Note: Don't use MAL Authentication with Suwayomi Server v1.0.0-r1498 as it's bugged</p>
<ul>
<li>Added a Strip Reader Implementation for vertical reading</li>
<li>Enhanced design for cards</li>
</ul>
<p>Fixed a bug with AniList import authentication</p>
</description>
</release>
</releases>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
public class AniListView extends TrackingLayout {

private final AniListAPIService aniListAPI;
private final MangaList list;
private MangaList list;

/**
* AniListView is a view for displaying AniList entries to import.
Expand All @@ -36,7 +36,10 @@ public AniListView(AniListAPIService apiService) {
addClassName("anilist-view");

this.aniListAPI = apiService;
this.list = apiService.getMangaList();

if (hasToken()) {
this.list = apiService.getMangaList();
}

init();
}
Expand All @@ -61,6 +64,15 @@ public void authenticate() {

@Override
public Div getReadingSection() {
// Only need to check in this method since all other methods get called after this one
if (list == null) {
if (!hasToken()) {
throw new IllegalStateException("getReadingSection called without token");
}

list = aniListAPI.getMangaList();
}

var cards = getCards(list.reading());

return getContentSection("Reading", cards);
Expand Down

0 comments on commit 3d673f2

Please sign in to comment.