fixed: create peripheral

This commit is contained in:
2025-11-30 18:33:00 +01:00
parent d1fda9f075
commit 7f60f7b8d7
8 changed files with 83 additions and 138 deletions

View File

@@ -4,13 +4,13 @@
import { t, _ } from 'svelte-i18n'
import { generateToast, needProjectSave, peripherals, colors } from "../../stores";
import { get } from "svelte/store"
import { UpdatePeripheralSettings, GetPeripheralSettings, RemovePeripheral, AddPeripheral, CreatePeripheral } from "../../../wailsjs/go/main/App";
import { UpdatePeripheralSettings, GetPeripheralSettings, RemovePeripheral, AddPeripheral } from "../../../wailsjs/go/main/App";
import RoundedButton from "../General/RoundedButton.svelte";
// Create the peripheral to the project
function createPeripheral(peripheral){
// Create the peripheral to the project (backend)
CreatePeripheral(peripheral)
AddPeripheral(peripheral)
.catch((error) => {
console.log("Unable to create the peripheral: " + error)
generateToast('danger', 'bx-error', $_("addPeripheralErrorToast"))