Skip to content

Commit f465a01

Browse files
committed
Added error prompt when trying to rename filter group
1 parent 87cb4c5 commit f465a01

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

src/EventLogExpert/Shared/Components/Filters/FilterGroup.razor.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,19 @@ private async Task RenameGroup()
114114
{
115115
var newName = await AlertDialogService.DisplayPrompt("Group Name", "What would you like to name this group?", Group.Name);
116116

117-
if (string.IsNullOrEmpty(newName) || string.Equals(newName, Group.Name)) { return; }
117+
if (string.IsNullOrEmpty(newName))
118+
{
119+
await AlertDialogService.ShowAlert("Rename Failed", "Name cannot be empty", "OK");
120+
121+
return;
122+
}
123+
124+
if (string.Equals(newName, Group.Name))
125+
{
126+
await AlertDialogService.ShowAlert("Rename Failed", "Name cannot be the same as previous name", "OK");
127+
128+
return;
129+
}
118130

119131
Dispatcher.Dispatch(new FilterGroupAction.SetGroup(Group with { Name = newName }));
120132
}

0 commit comments

Comments
 (0)