fix(magic): remove device-release from Magic sheet, Magic does not remove devices

This commit is contained in:
chahinebrini 2026-06-17 02:59:05 +02:00
parent 81c516b831
commit 4c46ac69c9
2 changed files with 0 additions and 29 deletions

View File

@ -172,19 +172,6 @@
</div>
</section>
<!-- Remove device -->
<section class="pt-2">
<UButton
color="error"
variant="soft"
size="md"
icon="i-heroicons-trash-20-solid"
block
@click="emit('remove', device)"
>
Gerät entfernen
</UButton>
</section>
</div>
</template>
@ -221,7 +208,6 @@ const emit = defineEmits<{
(e: "toggle-protection", device: ComputedDevice): void;
(e: "start-cooldown", device: ComputedDevice, minutes: number): void;
(e: "cancel-cooldown", device: ComputedDevice): void;
(e: "remove", device: ComputedDevice): void;
}>();
const open = defineModel<boolean>("open", { default: false });

View File

@ -142,7 +142,6 @@
@toggle-protection="toggleProtection"
@start-cooldown="startCooldown"
@cancel-cooldown="cancelCooldown"
@remove="requestDeviceRelease"
/>
</div>
</template>
@ -157,7 +156,6 @@ import rebreakIcon from "~/assets/rebreak-icon.png";
const {
getMagicDevices,
requestRelease,
startCooldown: apiStartCooldown,
cancelCooldown: apiCancelCooldown,
logoutMagic,
@ -292,19 +290,6 @@ async function cancelCooldown(device: ComputedDevice) {
}
}
async function requestDeviceRelease(device: ComputedDevice) {
loading.value = true;
try {
await requestRelease(device.deviceId);
sheetOpen.value = false;
await refresh();
} catch (e: any) {
error.value = e?.message ?? "Freigabe fehlgeschlagen";
} finally {
loading.value = false;
}
}
async function logout() {
try {
await logoutMagic();