@@ -16,29 +16,54 @@ import { BrowserService } from "../../services/browser.service";
1616export class ToolsComponent implements OnInit {
1717 eventTokenInfo : Subject < boolean > = new Subject < boolean > ( )
1818 eventTokenUsage : Subject < boolean > = new Subject < boolean > ( )
19+ eventWarning : Subject < boolean > = new Subject < boolean > ( )
20+ experimentalMessage : boolean = false ;
21+ warningMessage : string = "" ;
1922 view : string = "" ;
20- id_links :boolean = false ;
23+ id_links : boolean = false ;
2124 constructor (
2225 private _cd : ChangeDetectorRef ,
23- private _browser : BrowserService
26+ private _browser : BrowserService
2427 ) { }
2528
2629 ngOnInit ( ) {
27- this . _browser . getStorage ( "id_links" , ( result ) => {
30+ this . _browser . getStorage ( "id_links" , ( result ) => {
2831 if ( result == "true" ) this . id_links = true ;
2932 else this . id_links = false ;
3033 } )
3134 }
3235
33- changeIdLinks ( ) :void {
34- console . log ( this . id_links )
35- if ( this . id_links ) this . _browser . setStorage ( "id_links" , "true" ) ;
36- else this . _browser . setStorage ( "id_links" , "false" ) ;
36+ changeIdLinks ( ) : void {
37+ if ( this . id_links ) {
38+ this . view = "warning" ;
39+ this . experimentalMessage = true ;
40+ this . warningMessage = "It may not work as expected and may impact your browser performance, especially on Mist API pages with a large number of entries." ;
41+ this . eventWarning . next ( true ) ;
42+ this . _cd . detectChanges ( ) ;
43+ //this._browser.setStorage("id_links", "true")
44+ } else this . _browser . setStorage ( "id_links" , "false" ) ;
3745 }
3846
39- openPopup ( view :string ) : void {
47+ warningConfirm ( ) : void {
48+ this . view = "" ;
49+ this . experimentalMessage = false ;
50+ this . _browser . setStorage ( "id_links" , "true" ) ;
51+ this . id_links = true ;
52+ this . eventWarning . next ( false ) ;
53+ this . _cd . detectChanges ( ) ;
54+ }
55+ warningCancel ( ) : void {
56+ this . view = "" ;
57+ this . experimentalMessage = false ;
58+ this . _browser . setStorage ( "id_links" , "false" ) ;
59+ this . id_links = false ;
60+ this . eventWarning . next ( false ) ;
61+ this . _cd . detectChanges ( ) ;
62+ }
63+
64+ openPopup ( view : string ) : void {
4065 this . view = view ;
41- switch ( view ) {
66+ switch ( view ) {
4267 case "token-info" :
4368 this . eventTokenInfo . next ( true )
4469 break ;
@@ -49,9 +74,9 @@ export class ToolsComponent implements OnInit {
4974 this . _cd . detectChanges ( ) ;
5075 }
5176
52- closePopup ( view :string ) : void {
77+ closePopup ( view : string ) : void {
5378 this . view = "" ;
54- switch ( view ) {
79+ switch ( view ) {
5580 case "token-info" :
5681 this . eventTokenInfo . next ( false )
5782 break ;
0 commit comments