Fix missing / doubled calendar owners in sidemenu

This commit is contained in:
nathan 2022-12-08 14:26:17 -07:00
parent 26d4082cda
commit 05a4fc2758
2 changed files with 6 additions and 5 deletions

View File

@ -299,7 +299,7 @@ class calendar_owner_etemplate_widget extends Etemplate\Widget\Taglist
$type = $data['type']; $type = $data['type'];
$value = array( $value = array(
'value' => substr($id, 0, -1) == $type ? $id : $type . $id, 'value' => substr($id, 0, 1) == $type ? $id : $type . $id,
'label' => $title, 'label' => $title,
'app' => lang($data['app']) 'app' => lang($data['app'])
); );

View File

@ -79,13 +79,14 @@ export class CalendarOwner extends Et2Select
} }
// Put it in the list of options // Put it in the list of options
let index = this.select_options.findIndex(o => o.value == owner); let index = this.select_options.findIndex(o => o.value == owner);
if(index !== -1) let remote_index = this._selected_remote.findIndex(o => o.value == owner);
if(remote_index !== -1)
{ {
this.select_options[index] = data[owner]; this._selected_remote[remote_index] = data[owner];
} }
else else if(index == -1)
{ {
this.select_options.push(data[owner]); this._selected_remote.push(data[owner]);
} }
} }
this.requestUpdate("select_options"); this.requestUpdate("select_options");