loottracker: Run database related code in the subscription (#1780)
This commit is contained in:
@@ -352,7 +352,6 @@ public class LootTrackerPlugin extends Plugin
|
||||
@Override
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
Completable.fromAction(this::initDatabase).subscribeOn(Schedulers.io()).subscribe();
|
||||
addSubscriptions();
|
||||
|
||||
ignoredItems = Text.fromCSV(config.getIgnoredItems());
|
||||
@@ -372,10 +371,13 @@ public class LootTrackerPlugin extends Plugin
|
||||
|
||||
clientToolbar.addNavigation(navButton);
|
||||
|
||||
Completable.fromAction(this::initDatabase)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.subscribe(() ->
|
||||
{
|
||||
AccountSession accountSession = sessionManager.getAccountSession();
|
||||
if (accountSession != null || this.localPersistence)
|
||||
{
|
||||
|
||||
clientThread.invokeLater(() ->
|
||||
{
|
||||
switch (client.getGameState())
|
||||
@@ -472,6 +474,7 @@ public class LootTrackerPlugin extends Plugin
|
||||
return true;
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user