mirror of
https://github.com/wekan/wekan.git
synced 2025-12-30 14:18:48 +01:00
fix empty parentId in cards
- if the parentId is undefined or empty, the code run in a infinite loop and the browser "hangs"
This commit is contained in:
parent
b6ce81dc79
commit
8a7a4f3033
1 changed files with 12 additions and 7 deletions
|
|
@ -982,15 +982,16 @@ Cards.helpers({
|
|||
},
|
||||
|
||||
parentCard() {
|
||||
if (this.parentId === '') {
|
||||
return null;
|
||||
let ret = null;
|
||||
if (this.parentId) {
|
||||
ret = ReactiveCache.getCard(this.parentId);
|
||||
}
|
||||
return ReactiveCache.getCard(this.parentId);
|
||||
return ret;
|
||||
},
|
||||
|
||||
parentCardName() {
|
||||
let result = '';
|
||||
if (this.parentId !== '') {
|
||||
if (this.parentId) {
|
||||
const card = ReactiveCache.getCard(this.parentId);
|
||||
if (card) {
|
||||
result = card.title;
|
||||
|
|
@ -1002,7 +1003,7 @@ Cards.helpers({
|
|||
parentListId() {
|
||||
const result = [];
|
||||
let crtParentId = this.parentId;
|
||||
while (crtParentId !== '') {
|
||||
while (crtParentId) {
|
||||
const crt = ReactiveCache.getCard(crtParentId);
|
||||
if (crt === null || crt === undefined) {
|
||||
// maybe it has been deleted
|
||||
|
|
@ -1022,7 +1023,7 @@ Cards.helpers({
|
|||
const resultId = [];
|
||||
const result = [];
|
||||
let crtParentId = this.parentId;
|
||||
while (crtParentId !== '') {
|
||||
while (crtParentId) {
|
||||
const crt = ReactiveCache.getCard(crtParentId);
|
||||
if (crt === null || crt === undefined) {
|
||||
// maybe it has been deleted
|
||||
|
|
@ -1048,7 +1049,11 @@ Cards.helpers({
|
|||
},
|
||||
|
||||
isTopLevel() {
|
||||
return this.parentId === '';
|
||||
let ret = false;
|
||||
if (this.parentId) {
|
||||
ret = true;
|
||||
}
|
||||
return ret;
|
||||
},
|
||||
|
||||
isLinkedCard() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue