Skip to content

Commit

Permalink
Revert resuing VimeoClient instance for initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohit Sarveiya committed Jan 25, 2018
1 parent c823f7a commit debf218
Showing 1 changed file with 1 addition and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,23 +137,10 @@ public static VimeoClient getInstance() {
}

public static void initialize(@NotNull Configuration configuration) {
if (sSharedInstance != null) {
sSharedInstance.mConfiguration.deleteAccount(sSharedInstance.mVimeoAccount);
sSharedInstance.setup(configuration);
} else {
sSharedInstance = new VimeoClient(configuration);
}
sSharedInstance = new VimeoClient(configuration);
}

private VimeoClient(@NotNull Configuration configuration) {
setup(configuration);
}

/**
* Setup Retrofit object, API service and cache object to make requests.
* This setup is done when a new {@link Configuration} object is initialized.
*/
private void setup(final Configuration configuration) {
mConfiguration = configuration;
mConfiguration.mInterceptors.add(mBaseUrlInterceptor);
mCache = mConfiguration.getCache();
Expand Down

0 comments on commit debf218

Please sign in to comment.