diff --git a/frontend_v2/src/app/components/challenge/challenge.component.ts b/frontend_v2/src/app/components/challenge/challenge.component.ts
index 4f94271ab8..c374cb28ce 100644
--- a/frontend_v2/src/app/components/challenge/challenge.component.ts
+++ b/frontend_v2/src/app/components/challenge/challenge.component.ts
@@ -37,6 +37,11 @@ export class ChallengeComponent implements OnInit {
*/
isChallengeHost = false;
+ /**
+ * Is challenge approved by admin
+ */
+ isApprovedByAdmin = false;
+
/**
* Is participated in Challenge
*/
@@ -107,6 +112,7 @@ export class ChallengeComponent implements OnInit {
this.challenge = challenge;
this.isForumEnabled = challenge.enable_forum;
this.forumURL = challenge.forum_url;
+ this.isApprovedByAdmin = challenge.approved_by_admin;
// update meta tag
SELF.meta.updateTag({
property: 'og:title',
diff --git a/frontend_v2/src/app/components/not-found/not-found.component.scss b/frontend_v2/src/app/components/not-found/not-found.component.scss
index cd43605715..e2c7faa0dd 100644
--- a/frontend_v2/src/app/components/not-found/not-found.component.scss
+++ b/frontend_v2/src/app/components/not-found/not-found.component.scss
@@ -5,7 +5,7 @@
background: $red-light;
color: white;
overflow: hidden;
- position: absolute;
+ position: fixed;
top: 0;
width: 100%;
left: 0;
diff --git a/frontend_v2/src/app/services/challenge.service.ts b/frontend_v2/src/app/services/challenge.service.ts
index 91a1bdd648..e6813f65bd 100644
--- a/frontend_v2/src/app/services/challenge.service.ts
+++ b/frontend_v2/src/app/services/challenge.service.ts
@@ -1,6 +1,7 @@
import { Injectable } from '@angular/core';
import { BehaviorSubject } from 'rxjs';
import { NGXLogger } from 'ngx-logger';
+import { Router } from '@angular/router';
// import service
import { ApiService } from './api.service';
@@ -50,7 +51,8 @@ export class ChallengeService {
private globalService: GlobalService,
private authService: AuthService,
private endpointsService: EndpointsService,
- private logger: NGXLogger
+ private logger: NGXLogger,
+ private router: Router
) {}
/**
@@ -183,6 +185,9 @@ export class ChallengeService {
},
(err) => {
SELF.globalService.handleApiError(err);
+ if(err.error.error == "Challenge does not exist!") {
+ this.router.navigate(['not-found']);
+ }
},
() => {
this.logger.info('Challenge', id, 'fetched!');