Skip to content

Commit

Permalink
feat: allow simulated events to force run (crowbartools#1889)
Browse files Browse the repository at this point in the history
  • Loading branch information
zunderscore authored Sep 3, 2022
1 parent a53eb57 commit b8ef5b4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/backend/events/EventManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,9 @@ ipcMain.on("triggerManualEvent", function(_, data) {

frontendCommunicator.on("simulateEvent", (eventData) => {
if (Object.keys(eventData.metadata).length > 0) {
manager.triggerEvent(eventData.sourceId, eventData.eventId, eventData.metadata, true, false, true);
manager.triggerEvent(eventData.sourceId, eventData.eventId, eventData.metadata, true, eventData.forceRetrigger, true);
} else {
manager.triggerEvent(eventData.sourceId, eventData.eventId, null, true, false, true);
manager.triggerEvent(eventData.sourceId, eventData.eventId, null, true, eventData.forceRetrigger, true);
}
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@
></searchable-event-dropdown>
</div>
<div>
<label class="control-fb control--checkbox"> Force event to run <tooltip text="'This will ensure that the simulated event will run, even if a similar event was recently triggered.'"></tooltip>
<input type="checkbox" ng-model="$ctrl.eventData.forceRetrigger">
<div class="control__indicator"></div>
</label>
</div>
<div ng-if="$ctrl.metadata">
<command-option
ng-repeat="data in $ctrl.metadata"
Expand All @@ -46,7 +53,8 @@
$ctrl.eventData = {
eventId: null,
sourceId: null,
metadata: {}
metadata: {},
forceRetrigger: false
};
$ctrl.eventError = false;

Expand Down

0 comments on commit b8ef5b4

Please sign in to comment.