Merge pull request #4329 from MaximilianKrambach/fixSubmitters

fix submitter updating
This commit is contained in:
Emanuel Schütze 2019-02-13 12:37:06 +01:00 committed by GitHub
commit 7952a9165d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -483,11 +483,7 @@ export class ViewMotion extends BaseAgendaViewModel implements Searchable {
public updateUser(update: ViewUser): void { public updateUser(update: ViewUser): void {
if (this.motion.submitters && this.motion.submitters.findIndex(user => user.user_id === update.id)) { if (this.motion.submitters && this.motion.submitters.findIndex(user => user.user_id === update.id)) {
const userIndex = this.submitters.findIndex(user => user.id === update.id); const userIndex = this.submitters.findIndex(user => user.id === update.id);
if (userIndex < 0) { this.submitters[userIndex] = update;
this.submitters.push(update);
} else {
this.submitters[userIndex] = update;
}
} }
if (this.motion.supporters_id && this.motion.supporters_id.includes(update.id)) { if (this.motion.supporters_id && this.motion.supporters_id.includes(update.id)) {
const userIndex = this.supporters.findIndex(user => user.id === update.id); const userIndex = this.supporters.findIndex(user => user.id === update.id);