Fixed indexing bug in cell editor dialog
This commit is contained in:
@@ -127,9 +127,10 @@
|
||||
<div class="critical-editor-inline-list">
|
||||
@for (var index = 0; index < Model.Effects.Count; index++)
|
||||
{
|
||||
var effect = Model.Effects[index];
|
||||
var i = index;
|
||||
var effect = Model.Effects[i];
|
||||
<div class="critical-editor-inline-row">
|
||||
@InlineEffectRow(effect, () => RemoveBaseEffect(index))
|
||||
@InlineEffectRow(effect, () => RemoveBaseEffect(i))
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
@@ -152,14 +153,15 @@
|
||||
{
|
||||
@for (var index = 0; index < Model.Branches.Count; index++)
|
||||
{
|
||||
var branch = Model.Branches[index];
|
||||
var i = index;
|
||||
var branch = Model.Branches[i];
|
||||
<div class="critical-editor-card branch-card-editor">
|
||||
<div class="critical-editor-card-header">
|
||||
<div>
|
||||
<strong>@GetBranchTitle(branch, index)</strong>
|
||||
<strong>@GetBranchTitle(branch, i)</strong>
|
||||
<p class="muted critical-editor-inline-copy">Shown only when this condition applies.</p>
|
||||
</div>
|
||||
<button type="button" class="critical-editor-inline-button" @onclick="() => RemoveBranch(index)">Remove</button>
|
||||
<button type="button" class="critical-editor-inline-button" @onclick="() => RemoveBranch(i)">Remove</button>
|
||||
</div>
|
||||
<div class="critical-editor-branch-line">
|
||||
<div class="field-shell">
|
||||
@@ -190,9 +192,10 @@
|
||||
<div class="critical-editor-inline-list">
|
||||
@for (var effectIndex = 0; effectIndex < branch.Effects.Count; effectIndex++)
|
||||
{
|
||||
var effect = branch.Effects[effectIndex];
|
||||
var j = effectIndex;
|
||||
var effect = branch.Effects[j];
|
||||
<div class="critical-editor-inline-row">
|
||||
@InlineEffectRow(effect, () => RemoveBranchEffect(branch, effectIndex))
|
||||
@InlineEffectRow(effect, () => RemoveBranchEffect(branch, j))
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user