@@ -5,7 +5,6 @@ import {ActivatedRoute, Router} from "@angular/router";
5
5
import { NgbModal } from "@ng-bootstrap/ng-bootstrap" ;
6
6
import { RequestSupportComponent } from "@app/shared/modals/request-support/request-support.component" ;
7
7
import { HttpService } from "@app/shared/services/http.service" ;
8
- import { TokenResource } from "@app/shared/services/token-resource.service" ;
9
8
import { HttpClient , HttpHeaders } from "@angular/common/http" ;
10
9
import { Observable , from , map , switchMap } from "rxjs" ;
11
10
import { ConfirmationWithPasswordComponent } from "@app/shared/modals/confirmation-with-password/confirmation-with-password.component" ;
@@ -40,7 +39,6 @@ export class UtilsService {
40
39
private activatedRoute = inject ( ActivatedRoute ) ;
41
40
private appDataService = inject ( AppDataService ) ;
42
41
private cryptoService = inject ( CryptoService ) ;
43
- private tokenResource = inject ( TokenResource ) ;
44
42
private translateService = inject ( TranslateService ) ;
45
43
private clipboardService = inject ( ClipboardService ) ;
46
44
private http = inject ( HttpClient ) ;
@@ -86,17 +84,6 @@ export class UtilsService {
86
84
return ret ;
87
85
}
88
86
89
- download ( url : string ) : Observable < void > {
90
- return from ( this . tokenResource . getWithProofOfWork ( ) ) . pipe (
91
- switchMap ( ( token : any ) => {
92
- window . open ( `${ url } ?token=${ token . id } :${ token . answer } ` ) ;
93
- return new Observable < void > ( ( observer ) => {
94
- observer . complete ( ) ;
95
- } ) ;
96
- } )
97
- ) ;
98
- }
99
-
100
87
isUploading ( uploads ?: any ) {
101
88
if ( uploads ) {
102
89
for ( const key in uploads ) {
@@ -108,14 +95,6 @@ export class UtilsService {
108
95
return false ;
109
96
}
110
97
111
- removeStyles ( renderer : Renderer2 , document :Document , link :string ) {
112
- const defaultBootstrapLink = document . head . querySelector ( `link[href="${ link } "]` ) ;
113
- if ( defaultBootstrapLink ) {
114
- renderer . removeChild ( document . head , defaultBootstrapLink ) ;
115
- }
116
- }
117
-
118
-
119
98
resumeFileUploads ( uploads : any ) {
120
99
if ( uploads ) {
121
100
for ( const key in uploads ) {
@@ -252,8 +231,8 @@ export class UtilsService {
252
231
}
253
232
254
233
isWhistleblowerPage ( ) {
255
- const currentUrl = this . router . url ;
256
- return this . appDataService . public . node . wizard_done && ( ! this . authenticationService . session || ( location . hash === "#/" || location . hash . startsWith ( "#/submission" ) ) ) && ( ( currentUrl === "/" && ! this . appDataService . public . node . enable_signup ) || currentUrl === "/submission" || currentUrl === "/blank" ) ;
234
+ const currentHash = location . hash ;
235
+ return currentHash === "#/" || currentHash === "# /submission" ;
257
236
}
258
237
259
238
stopPropagation ( event : Event ) {
0 commit comments