diff --git a/static/src/app/pub/decoration-overview/decoration-overview.component.html b/static/src/app/pub/decoration-overview/decoration-overview.component.html
index 5e7b72f..20b199c 100644
--- a/static/src/app/pub/decoration-overview/decoration-overview.component.html
+++ b/static/src/app/pub/decoration-overview/decoration-overview.component.html
@@ -7,7 +7,7 @@
GLOBAL
-
+
{
this.decorations = decorations;
- this.switchFraction('BLUFOR');
+ const queryParams = this.route.snapshot.queryParams;
+ if (queryParams.type < 2) {
+ this.selectedType = queryParams.type;
+ }
+
+ const fract = queryParams.fraction;
+ if (fract && (fract === 'BLUFOR' || fract === 'OPFOR' || fract === 'GLOBAL')) {
+ this.switchFraction(queryParams.fraction);
+ } else {
+ this.switchFraction('BLUFOR');
+ }
});
};
- switchFraction(value: string) {
+ switchFraction(value: any) {
this.medals = this.decorations.filter(d => d.fraction === value && d.isMedal);
this.ribbons = this.decorations.filter(d => d.fraction === value && !d.isMedal);
this.active = value;
+ this.adjustBrowserUrl(value)
+ }
+
+ switchTab(tabIndex) {
+ this.selectedType = tabIndex;
+ this.adjustBrowserUrl(this.active)
}
select(decoration: Decoration) {
this.bottomSheet.open(UserListSheetComponent, {data: {decoration: decoration}});
}
+
+ adjustBrowserUrl(fractionKey = '') {
+ const absoluteUrl = this.location.path().split('?')[0];
+ if (fractionKey === 'BLUFOR' && this.selectedType === 0) {
+ this.location.replaceState(absoluteUrl);
+ return;
+ }
+ const queryPart = fractionKey !== '' ? 'fraction='.concat(fractionKey)
+ .concat('&type=' + this.selectedType) : 'type=0';
+
+ this.location.replaceState(absoluteUrl, queryPart);
+ }
}