Skip to content

Commit

Permalink
Fix init help order
Browse files Browse the repository at this point in the history
  • Loading branch information
minottic committed Aug 27, 2024
1 parent 604e546 commit c482767
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ describe('SearchWindowComponent', () => {
expect(component["_prepareConfig"]()).toEqual(t? t.configOut: defaultConfig);
if (t)
expect(component.searchStringFromConfig).toEqual(t.searchStringFromConfig);
expect(component.tags).toEqual(t?.tagsOut ?? [])
expect(component.tags).toEqual(t?.tagsOut ?? ['alignment'])
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,9 @@ export class SearchWindowComponent implements OnInit {
async ngOnInit(): Promise<void> {
this.searchString = this.searched;
this.logbookId = this.logbookInfo?.logbookInfo?.id;
this.tags = await this.tagService.getTags();
await this._initialize_help();
this.config = this._prepareConfig();

await this._initialize_help();
this.subscriptions.push(this.hotkeys.addShortcut({ keys: 'esc', description: { label: 'Close search', group: "General" } }).subscribe(() => {
this.closeSearch();
}));
Expand Down Expand Up @@ -85,17 +84,10 @@ export class SearchWindowComponent implements OnInit {
private async _initialize_help() {

this._sample_user = this.userPreferences.userInfo.username;
// roles.find((val)=>{
// if ((val.length == 6)&&(val.substring(0,1)=="p")){
// return true;
// }
// return false;
// })
if (typeof this._sample_user == 'undefined') {
this._sample_user = "p12345";
}
if (!this.logbookId) return
this.tags = this.tags.length > 0? this.tags: (await this.tagService?.getTags());
if (this.tags?.length == 0) {
this.tags = ["alignment"];
}
Expand Down

0 comments on commit c482767

Please sign in to comment.