Skip to content

Commit

Permalink
Merge pull request #282 from vimeo/revert-reuse-vimeoclient-instance
Browse files Browse the repository at this point in the history
Revert VimeoClient Initialization
  • Loading branch information
msya authored Jan 25, 2018
2 parents c823f7a + debf218 commit 8eb24fc
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 8eb24fc

Please sign in to comment.