diff --git a/static/src/app/request/award/req-award.component.html b/static/src/app/request/award/req-award.component.html
index e9ba9e2..eddd70c 100644
--- a/static/src/app/request/award/req-award.component.html
+++ b/static/src/app/request/award/req-award.component.html
@@ -10,6 +10,7 @@
[compareWith]="equals"
(change)="toggleUser(decoPreview, decoDescription)"
required>
+
diff --git a/static/src/app/request/award/req-award.component.ts b/static/src/app/request/award/req-award.component.ts
index 6935187..b41a02a 100644
--- a/static/src/app/request/award/req-award.component.ts
+++ b/static/src/app/request/award/req-award.component.ts
@@ -19,7 +19,7 @@ export class RequestAwardComponent {
showSuccessLabel = false;
- user: User = {};
+ user: User = {_id: '0'};
decoration: Decoration = null;
@@ -49,19 +49,23 @@ export class RequestAwardComponent {
}
toggleUser(previewImage, decoDescription) {
- this.decoration = null;
- if (previewImage && decoDescription) {
- previewImage.src = decoDescription.innerHTML = '';
+ if (this.user._id != '0') {
+ this.decoration = null;
+ if (previewImage && decoDescription) {
+ previewImage.src = decoDescription.innerHTML = '';
+ }
+ this.decorationService.findDecorations('', this.user.squad.fraction).subscribe(decorations => {
+ this.decorations = decorations;
+ });
+
+ this.awardingService.getUserAwardings(this.user._id).subscribe(awards => {
+ this.awards = awards;
+ });
+
+ this.showForm = true;
+ } else {
+ this.showForm = false;
}
- this.decorationService.findDecorations('', this.user.squad.fraction).subscribe(decorations => {
- this.decorations = decorations;
- });
-
- this.awardingService.getUserAwardings(this.user._id).subscribe(awards => {
- this.awards = awards;
- });
-
- this.showForm = true;
}
diff --git a/static/src/app/request/promotion/req-promotion.component.html b/static/src/app/request/promotion/req-promotion.component.html
index fddaa11..e8a082b 100644
--- a/static/src/app/request/promotion/req-promotion.component.html
+++ b/static/src/app/request/promotion/req-promotion.component.html
@@ -10,6 +10,7 @@
[compareWith]="equals"
required
(change)="toggleUser()">
+
diff --git a/static/src/app/request/promotion/req-promotion.component.ts b/static/src/app/request/promotion/req-promotion.component.ts
index e2dec44..7be13fc 100644
--- a/static/src/app/request/promotion/req-promotion.component.ts
+++ b/static/src/app/request/promotion/req-promotion.component.ts
@@ -19,7 +19,7 @@ export class RequestPromotionComponent {
showSuccessLabel = false;
- user: User = {};
+ user: User = {_id: '0'};
newLevel: number;
@@ -52,8 +52,12 @@ export class RequestPromotionComponent {
}
toggleUser() {
- this.showForm = true;
- this.newLevel = this.user.rank.level;
+ if (this.user._id != '0') {
+ this.showForm = true;
+ this.newLevel = this.user.rank.level;
+ } else {
+ this.showForm = false;
+ }
}