Skip to content
This repository has been archived by the owner on Jul 22, 2022. It is now read-only.

Commit

Permalink
Fix dashboard not loading on first login
Browse files Browse the repository at this point in the history
  • Loading branch information
xiprox committed Nov 29, 2017
1 parent d366739 commit d0c63b8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ public void onResponse(Call<Request<User>> call, Response<Request<User>> respons
if (response.isSuccessful() && response.body().user_information != null) {
PrefManager.setApiKey(mApiKey.getText().toString());
PrefManager.setFirstLaunch(false);
WaniKaniApi.init();
startActivity(new Intent(context, MainActivity.class));

// Set an alarm for notifications for the first time
Expand Down
16 changes: 6 additions & 10 deletions WaniKani/src/tr/xip/wanikani/client/WaniKaniApi.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
package tr.xip.wanikani.client;

import java.io.IOException;
import java.util.List;

import okhttp3.OkHttpClient;
import okhttp3.logging.HttpLoggingInterceptor;
import retrofit2.Call;
Expand All @@ -11,7 +8,6 @@
import tr.xip.wanikani.BuildConfig;
import tr.xip.wanikani.managers.PrefManager;
import tr.xip.wanikani.models.CriticalItemsList;
import tr.xip.wanikani.models.ItemsList;
import tr.xip.wanikani.models.KanjiList;
import tr.xip.wanikani.models.LevelProgression;
import tr.xip.wanikani.models.RadicalsList;
Expand All @@ -29,12 +25,12 @@ public abstract class WaniKaniApi {
private static String API_KEY;

static {
if (API_KEY == null) {
API_KEY = PrefManager.getApiKey();
}
if (service == null) {
setupService();
}
init();
}

public static void init() {
API_KEY = PrefManager.getApiKey();
setupService();
}

private static void setupService() {
Expand Down

0 comments on commit d0c63b8

Please sign in to comment.