mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-11-28 17:32:44 +08:00
Ensuring duplicate notification messages aren't displayed.
A problem in general. Helps to resolve... work item: 17529 --HG-- branch : 1.x
This commit is contained in:
@@ -69,16 +69,22 @@ namespace Orchard.UI.Notify {
|
|||||||
var delimiterIndex = line.IndexOf(':');
|
var delimiterIndex = line.IndexOf(':');
|
||||||
if (delimiterIndex != -1) {
|
if (delimiterIndex != -1) {
|
||||||
var type = (NotifyType)Enum.Parse(typeof(NotifyType), line.Substring(0, delimiterIndex));
|
var type = (NotifyType)Enum.Parse(typeof(NotifyType), line.Substring(0, delimiterIndex));
|
||||||
messageEntries.Add(new NotifyEntry {
|
var message = new LocalizedString(line.Substring(delimiterIndex + 1));
|
||||||
Type = type,
|
if (!messageEntries.Any(ne => ne.Message.TextHint == message.TextHint)) {
|
||||||
Message = new LocalizedString(line.Substring(delimiterIndex + 1))
|
messageEntries.Add(new NotifyEntry {
|
||||||
});
|
Type = type,
|
||||||
|
Message = message
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
messageEntries.Add(new NotifyEntry {
|
var message = new LocalizedString(line.Substring(delimiterIndex + 1));
|
||||||
Type = NotifyType.Information,
|
if (!messageEntries.Any(ne => ne.Message.TextHint == message.TextHint)) {
|
||||||
Message = new LocalizedString(line.Substring(delimiterIndex + 1))
|
messageEntries.Add(new NotifyEntry {
|
||||||
});
|
Type = NotifyType.Information,
|
||||||
|
Message = message
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user