mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 07:20:12 +01:00
parent
c7bbe47221
commit
b6e7b258e0
5 changed files with 667 additions and 29 deletions
|
|
@ -1235,13 +1235,20 @@ Boards.helpers({
|
|||
getDefaultSwimline() {
|
||||
let result = ReactiveCache.getSwimlane({ boardId: this._id });
|
||||
if (result === undefined) {
|
||||
// Use fallback title if i18n is not available (e.g., during migration)
|
||||
const title = TAPi18n && TAPi18n.i18n ? TAPi18n.__('default') : 'Default';
|
||||
Swimlanes.insert({
|
||||
title: title,
|
||||
boardId: this._id,
|
||||
});
|
||||
result = ReactiveCache.getSwimlane({ boardId: this._id });
|
||||
// Check if any swimlane exists for this board to avoid duplicates
|
||||
const existingSwimlanes = ReactiveCache.getSwimlanes({ boardId: this._id });
|
||||
if (existingSwimlanes.length > 0) {
|
||||
// Use the first existing swimlane
|
||||
result = existingSwimlanes[0];
|
||||
} else {
|
||||
// Use fallback title if i18n is not available (e.g., during migration)
|
||||
const title = TAPi18n && TAPi18n.i18n ? TAPi18n.__('default') : 'Default';
|
||||
Swimlanes.insert({
|
||||
title: title,
|
||||
boardId: this._id,
|
||||
});
|
||||
result = ReactiveCache.getSwimlane({ boardId: this._id });
|
||||
}
|
||||
}
|
||||
return result;
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue