Skip to content

Commit

Permalink
Merge pull request #109 from NazarUsov/testnet/issues
Browse files Browse the repository at this point in the history
Update get options
  • Loading branch information
cryptozoidberg authored Apr 12, 2024
2 parents 3b816ed + 0bc8dc7 commit 3b88286
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion html_source/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ export class AppComponent implements OnInit, OnDestroy {
this.backendService.initService().subscribe({
next: initMessage => {
console.log('Init message: ', initMessage);
this.backendService.getOptions();
this.backendService.webkitLaunchedScript();

this.backendService.start_backend(false, '127.0.0.1', 11512, (st2, dd2) => {
Expand Down Expand Up @@ -722,6 +721,7 @@ export class AppComponent implements OnInit, OnDestroy {
this.getVersion();

setTimeout(() => {
this.backendService.getOptions();
this.getInfo();
}, 10 * 1000);
},
Expand Down
2 changes: 2 additions & 0 deletions html_source/src/app/pages/settings/settings.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,8 @@ export class SettingsComponent implements OnInit {
this.scale = this.variablesService.settings.scale;
this.appUseTor = this.variablesService.settings.appUseTor;
this.zanoCompanionForm.setValue(this.variablesService.settings.zanoCompanionForm, { emitEvent: false });

this.backend.getOptions();
}

ngOnInit(): void {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Directive, OnDestroy, TemplateRef, ViewContainerRef } from '@angular/core';
import { VariablesService } from '../../services/variables.service';
import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
import { distinctUntilChanged, takeUntil } from 'rxjs/operators';

@Directive({
selector: '[appDisablePriceFetch]',
Expand All @@ -14,9 +14,12 @@ export class DisablePriceFetchDirective implements OnDestroy {
private _templateRef: TemplateRef<any>,
private _viewContainer: ViewContainerRef
) {
this._variablesService.disable_price_fetch$.pipe(takeUntil(this.destroy$)).subscribe({
this._variablesService.disable_price_fetch$.pipe(distinctUntilChanged(), takeUntil(this.destroy$)).subscribe({
next: (disable_price_fetch: boolean) => {
return !disable_price_fetch ? this._viewContainer.createEmbeddedView(this._templateRef) : this._viewContainer.clear();
this._viewContainer.clear();
if (!disable_price_fetch) {
this._viewContainer.createEmbeddedView(this._templateRef);
}
},
});
}
Expand Down

0 comments on commit 3b88286

Please sign in to comment.