Skip to content

Commit 57ee03d

Browse files
committed
Small improvements to the QuickConnectDialogCompoennt
- rename noPfs property to pfsConfigured and negate values - more exact error text when no pfs is configured
1 parent 62543fd commit 57ee03d

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

src/app/components/quick-connect-dialog/quick-connect-dialog.component.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
>
2121
</app-token-input>
2222
<div
23-
*ngIf="loading || pfsError || noPfs || suggestions.length > 0"
23+
*ngIf="loading || pfsError || !pfsConfigured || suggestions.length > 0"
2424
[@stretchVertically]="'in'"
2525
>
2626
<app-connection-selector
@@ -41,7 +41,7 @@
4141
</ng-template>
4242
<ng-template #error>
4343
<div
44-
*ngIf="!noPfs; else no_pfs"
44+
*ngIf="pfsConfigured; else no_pfs"
4545
class="error"
4646
fxLayoutAlign="center"
4747
>
@@ -50,8 +50,8 @@
5050
</ng-template>
5151
<ng-template #no_pfs>
5252
<div class="error" fxLayoutAlign="center">
53-
You cannot use Quick Connect because you are using the private
54-
routing mode
53+
Quick Connect requires a pathfinding service, but no such
54+
service is configured
5555
</div>
5656
</ng-template>
5757
</div>

src/app/components/quick-connect-dialog/quick-connect-dialog.component.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ describe('QuickConnectDialogComponent', () => {
263263

264264
expect(component.suggestions.length).toEqual(0);
265265
expect(component.pfsError).toBe(true);
266-
expect(component.noPfs).toBe(false);
266+
expect(component.pfsConfigured).toBe(true);
267267
expect(component.form.controls.totalAmount.disabled).toBe(true);
268268
}));
269269

@@ -272,7 +272,7 @@ describe('QuickConnectDialogComponent', () => {
272272

273273
expect(component.suggestions.length).toEqual(0);
274274
expect(component.pfsError).toBe(true);
275-
expect(component.noPfs).toBe(false);
275+
expect(component.pfsConfigured).toBe(true);
276276
expect(component.form.controls.totalAmount.disabled).toBe(true);
277277
}));
278278

@@ -289,7 +289,7 @@ describe('QuickConnectDialogComponent', () => {
289289

290290
expect(component.suggestions.length).toEqual(0);
291291
expect(component.pfsError).toBe(true);
292-
expect(component.noPfs).toBe(true);
292+
expect(component.pfsConfigured).toBe(false);
293293
expect(component.form.controls.totalAmount.disabled).toBe(true);
294294
}));
295295
});

src/app/components/quick-connect-dialog/quick-connect-dialog.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export class QuickConnectDialogComponent implements OnInit, OnDestroy {
5353
suggestions: SuggestedConnection[] = [];
5454
loading = false;
5555
pfsError = false;
56-
noPfs = false;
56+
pfsConfigured = true;
5757

5858
private ngUnsubscribe = new Subject();
5959

@@ -112,7 +112,7 @@ export class QuickConnectDialogComponent implements OnInit, OnDestroy {
112112
const pathfindingServiceUrl$ = this.raidenService.getSettings().pipe(
113113
map((settings) => {
114114
if (!settings.pathfinding_service_address) {
115-
this.noPfs = true;
115+
this.pfsConfigured = false;
116116
throw new Error('No PFS set!');
117117
}
118118
return settings.pathfinding_service_address;
@@ -172,7 +172,7 @@ export class QuickConnectDialogComponent implements OnInit, OnDestroy {
172172
catchError((error, caught) => {
173173
this.loading = false;
174174
this.showError();
175-
if (this.noPfs) {
175+
if (!this.pfsConfigured) {
176176
return EMPTY;
177177
}
178178
return caught;

0 commit comments

Comments
 (0)