Skip to content

Commit 540ed18

Browse files
committed
only select writable cultures
1 parent a95086b commit 540ed18

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/packages/documents/documents/workspace/document-workspace.context.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,11 +536,15 @@ export class UmbDocumentWorkspaceContext
536536
const selected = activeVariantIds.concat(changedVariantIds);
537537
// Selected can contain entries that are not part of the options, therefor the modal filters selection based on options.
538538

539+
const readOnlyCultures = this.readOnlyState.getStates().map((s) => s.variantId.culture);
540+
const selectedCultures = selected.map((x) => x.toString()).filter((v, i, a) => a.indexOf(v) === i);
541+
const writable = selectedCultures.filter((x) => readOnlyCultures.includes(x) === false);
542+
539543
const options = await firstValueFrom(this.variantOptions);
540544

541545
return {
542546
options,
543-
selected: selected.map((x) => x.toString()).filter((v, i, a) => a.indexOf(v) === i),
547+
selected: writable,
544548
};
545549
}
546550

0 commit comments

Comments
 (0)