Fix for crowdfund perk editor

With no title entered, the editor got stuck in an endless loop, because it recursively invoked the save function without checking for the ID fallback being present.

Fixes #2862.
This commit is contained in:
Dennis Reimann
2021-09-09 09:20:48 +02:00
committed by Andrew Camilleri
parent de2c12c1df
commit 435f51a777

View File

@@ -340,8 +340,9 @@ document.addEventListener("DOMContentLoaded", function () {
return this.errors.length === 0;
},
saveEditingItem: function(){
if(!this.editingItem.id){
this.editingItem.id = this.editingItem.title.toLowerCase().trim();
const fallbackId = this.editingItem.title.toLowerCase().trim();
if(!this.editingItem.id && fallbackId){
this.editingItem.id = fallbackId;
this.$nextTick(this.saveEditingItem.bind(this));
return;
}