mirror of
https://github.com/hrfee/jfa-go.git
synced 2025-03-31 00:02:53 +00:00
user: fix welcome message sent value on NewUserFromAdmin
inverted since WelcomeNewUser returns a bool called "failed", rather than one indicating success.
This commit is contained in:
parent
58c2fa3dde
commit
41dff3d5bb
@ -63,7 +63,7 @@ func (app *appContext) NewUserFromAdmin(gc *gin.Context) {
|
||||
|
||||
welcomeMessageSentIfNecessary := true
|
||||
if nu.Created {
|
||||
welcomeMessageSentIfNecessary = app.WelcomeNewUser(nu.User, time.Time{})
|
||||
welcomeMessageSentIfNecessary = !app.WelcomeNewUser(nu.User, time.Time{})
|
||||
}
|
||||
|
||||
respondUser(nu.Status, nu.Created, welcomeMessageSentIfNecessary, nu.Message, gc)
|
||||
|
@ -103,7 +103,7 @@ class user implements User, SearchableItem {
|
||||
set selected(state: boolean) {
|
||||
this._selected = state;
|
||||
this._check.checked = state;
|
||||
state ? document.dispatchEvent(this._checkEvent) : document.dispatchEvent(this._uncheckEvent);
|
||||
state ? document.dispatchEvent(this._checkEvent()) : document.dispatchEvent(this._uncheckEvent());
|
||||
}
|
||||
|
||||
get name(): string { return this._username.textContent; }
|
||||
@ -481,8 +481,8 @@ class user implements User, SearchableItem {
|
||||
);
|
||||
}
|
||||
|
||||
private _checkEvent = new CustomEvent("accountCheckEvent");
|
||||
private _uncheckEvent = new CustomEvent("accountUncheckEvent");
|
||||
private _checkEvent = () => new CustomEvent("accountCheckEvent", {detail: this.id});
|
||||
private _uncheckEvent = () => new CustomEvent("accountUncheckEvent", {detail: this.id});
|
||||
|
||||
constructor(user: User) {
|
||||
this._row = document.createElement("tr") as HTMLTableRowElement;
|
||||
@ -696,7 +696,7 @@ class user implements User, SearchableItem {
|
||||
asElement = (): HTMLTableRowElement => { return this._row; }
|
||||
remove = () => {
|
||||
if (this.selected) {
|
||||
document.dispatchEvent(this._uncheckEvent);
|
||||
document.dispatchEvent(this._uncheckEvent());
|
||||
}
|
||||
this._row.remove();
|
||||
}
|
||||
@ -927,6 +927,17 @@ export class accountsList {
|
||||
state ? this._checkCount = count : 0;
|
||||
}
|
||||
|
||||
selectAllBetweenIDs = (startID: string, endID: string) => {
|
||||
let inRange = false;
|
||||
for (let id of this._ordering) {
|
||||
if (!(inRange || id == startID)) continue;
|
||||
inRange = true;
|
||||
if (!(this._table.contains(this._users[id].asElement()))) continue;
|
||||
this._users[id].selected = true;
|
||||
if (id == endID) return;
|
||||
}
|
||||
}
|
||||
|
||||
add = (u: User) => {
|
||||
let domAccount = new user(u);
|
||||
this._users[u.id] = domAccount;
|
||||
|
Loading…
Reference in New Issue
Block a user