Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: toggle connection effect (#2454) #2470

Merged
merged 2 commits into from
Mar 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/backend/app-management/electron/window-management.js
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ async function createMainWindow() {
);

// wait for the main window's content to load, then show it
mainWindow.webContents.on("did-finish-load", () => {
mainWindow.webContents.on("did-finish-load", async () => {


createTray(mainWindow);
Expand All @@ -449,7 +449,7 @@ async function createMainWindow() {
}

const startupScriptsManager = require("../../common/handlers/custom-scripts/startup-scripts-manager");
startupScriptsManager.runStartupScripts();
await startupScriptsManager.runStartupScripts();

const eventManager = require("../../events/EventManager");
eventManager.triggerEvent("firebot", "firebot-started", {
Expand Down
10 changes: 5 additions & 5 deletions src/backend/effects/builtin/toggle-connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,12 @@ const toggleConnection = {
$scope.effect.services = [];
}

$scope.serviceIsSelected = (serviceId) => $scope.effect.services.some(s => s.id === serviceId);
$scope.serviceIsSelected = serviceId => $scope.effect.services.some(s => s.id === serviceId);

$scope.toggleServiceSelected = (serviceId) => {
if ($scope.serviceIsSelected(serviceId)) {
$scope.effect.services = $scope.effect.services.filter(
(s) => s.id !== serviceId
s => s.id !== serviceId
);
} else {
$scope.effect.services.push({
Expand All @@ -92,7 +92,7 @@ const toggleConnection = {
action
) => {
const service = $scope.effect.services.find(
(s) => s.id === serviceId
s => s.id === serviceId
);
if (service != null) {
service.action = action;
Expand All @@ -101,7 +101,7 @@ const toggleConnection = {

$scope.getConnectionActionDisplay = (serviceId) => {
const service = $scope.effect.services.find(
(s) => s.id === serviceId
s => s.id === serviceId
);
if (service == null) {
return "";
Expand Down Expand Up @@ -153,7 +153,7 @@ const toggleConnection = {
.getAllIntegrationDefinitions()
.filter(i => integrationManager.integrationIsConnectable(i.id))
.map(i => ({
id: i.id,
id: `integration.${i.id}`,
action: effect.allAction
}))
];
Expand Down
Loading