Skip to content

Commit

Permalink
fix(picked-items): ignore/remove empty query parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveVanOpstal committed Jun 26, 2017
1 parent 51e5373 commit 63fd977
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/client/services/picked-items.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,12 @@ export class PickedItemsService {

private updateQuery(items: Array<Item>) {
let urlTree = this.getUrlTree();
urlTree.queryParams['q'] = this.encodeItems(items);
let encodedItems = this.encodeItems(items);
if (encodedItems.length <= 0) {
urlTree.queryParams = {};
} else {
urlTree.queryParams['q'] = encodedItems;
}
let url = this.serializer.serialize(urlTree);
this.location.replaceState(url);
}
Expand Down

0 comments on commit 63fd977

Please sign in to comment.