Skip to content

Commit

Permalink
fix user login button
Browse files Browse the repository at this point in the history
  • Loading branch information
sdumetz committed Dec 13, 2024
1 parent 930ec8c commit c80ffe5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion source/server/templates/error.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@
overflow: auto;
}
</style>
<script src="/dist/js/corpus.js"></script>
<script async src="/dist/js/corpus.js"></script>
5 changes: 2 additions & 3 deletions source/ui/composants/navbar/UserButton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,11 @@ export default class UserMenu extends i18n(NavLink){

connectedCallback(): void {
super.connectedCallback();
this.innerHTML = this.user?.username || this.t("ui.login");
}

override onClick = (ev :MouseEvent)=>{
ev.preventDefault();
if(this.user?.username){
if(this.user?.uid){
navigate(this);
}else{
Modal.show({
Expand All @@ -47,7 +46,7 @@ export default class UserMenu extends i18n(NavLink){
{
let s = super.shouldUpdate(changedProperties);
if(changedProperties.has("user") || changedProperties.has("language")){
this.innerHTML = this.user?.username || this.t("ui.login");
this.innerHTML = ((this.user?.uid)? this.user.username : this.t("ui.login"));
return true;
}
return s;
Expand Down

0 comments on commit c80ffe5

Please sign in to comment.