Skip to content

Commit

Permalink
Fix: List all reasons in every use (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
RikudouSage committed Sep 13, 2023
1 parent f804875 commit 3aabb7a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ export class CensureInstanceComponent implements OnInit {

this.form.patchValue({instance: query['instance']});
});
let availableReasons = await toPromise(this.api.getUsedReasons([
this.authManager.currentInstanceSnapshot.name,
]));
let availableReasons = await toPromise(this.api.getUsedReasons());
if (availableReasons === null) {
this.messageService.createWarning(`Couldn't get list of reasons you've used previously, autocompletion won't work.`);
availableReasons = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ export class HesitateOnInstanceComponent implements OnInit {

this.form.patchValue({instance: query['instance']});
});
let availableReasons = await toPromise(this.api.getUsedReasons([
this.authManager.currentInstanceSnapshot.name,
]));
let availableReasons = await toPromise(this.api.getUsedReasons());
if (availableReasons === null) {
this.messageService.createWarning(`Couldn't get list of reasons you've used previously, autocompletion won't work.`);
availableReasons = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,13 @@ export class FilterFormComponent<TSettings extends SynchronizationSettings> impl

this._purgeChanged.next(purge);
});
this.form.controls.filterByReasons.valueChanges.subscribe(filter => {
if (!filter) {
return;
}

this.loadReasons();
});

if (this.form.controls.mode.value) {
this.loadCustomInstancesSelect(this.form.controls.mode.value);
Expand Down

0 comments on commit 3aabb7a

Please sign in to comment.