forked from DebaucheryLibrarian/traxxx
Converting expression before storing. Pre-fixed some Bang! channel names with 'Bang!'.
This commit is contained in:
@@ -41,7 +41,9 @@ async function addAlert(alert, sessionUser) {
|
||||
alert.matches?.length > 0 && bulkInsert('alerts_matches', alert.matches.map((match) => ({
|
||||
alert_id: alertId,
|
||||
property: match.property,
|
||||
expression: match.expression,
|
||||
expression: /\/.*\//.test(match.expression)
|
||||
? match.expression.slice(1, -1)
|
||||
: escapeRegexp(match.expression),
|
||||
})), false),
|
||||
alert.stashes?.length > 0 && bulkInsert('alerts_stashes', alert.stashes.map((stashId) => ({
|
||||
alert_id: alertId,
|
||||
@@ -115,9 +117,7 @@ async function notify(scenes) {
|
||||
|
||||
acc[alertMatch.alert_id].push({
|
||||
property: alertMatch.property,
|
||||
expression: /\/.*\//.test(alertMatch.expression)
|
||||
? new RegExp(alertMatch.expression.slice(1, -1), 'ui')
|
||||
: new RegExp(escapeRegexp(alertMatch.expression), 'ui'),
|
||||
expression: new RegExp(alertMatch.expression, 'ui'),
|
||||
});
|
||||
|
||||
return acc;
|
||||
|
||||
Reference in New Issue
Block a user