Skip to content

Commit

Permalink
fix(core): filter empty URL parts in ApiService, do not next schedule…
Browse files Browse the repository at this point in the history
…r on unsubscribe (#7000)
  • Loading branch information
anotherchrisberry authored May 15, 2019
1 parent 52c637b commit b888ff5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 4 additions & 1 deletion app/scripts/modules/core/src/api/ApiService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { $q, $http } from 'ngimport';
import { AuthenticationInitializer } from '../authentication/AuthenticationInitializer';
import { SETTINGS } from 'core/config/settings';
import { ICache } from 'core/cache';
import { isNil } from 'lodash';

export interface IRequestBuilder {
config?: IRequestConfig;
Expand Down Expand Up @@ -166,7 +167,9 @@ export class API {
method: '',
url: this.baseUrl,
};
urls.forEach((url: string) => (config.url = `${config.url}/${url.toString().replace(/^\/+/, '')}`));
urls
.filter(i => !isNil(i))
.forEach((url: string) => (config.url = `${config.url}/${url.toString().replace(/^\/+/, '')}`));

return this.baseReturn(config);
}
Expand Down
1 change: 0 additions & 1 deletion app/scripts/modules/core/src/scheduler/SchedulerFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ export class SchedulerFactory {
unsubscribe: () => {
suspended = true;
if (scheduler) {
scheduler.next(false);
scheduler.unsubscribe();
}
scheduler = null;
Expand Down

0 comments on commit b888ff5

Please sign in to comment.