mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-10-22 03:49:18 +02:00
fix(inventory): enable Clear RFID Tag for a tray-UUID-only spool (issue #3109)
The button gated on tag_uid alone. A spool linked by its 32-character Bambu tray UUID carries none -- Bambuddy splits a stored tag by length, so a 32-char value becomes tray_uuid and tag_uid stays empty. In Spoolman mode that is every Bambu Lab spool synced from the AMS; on the reporter's instance, 35 of 39 tagged spools, none of which could have its tag cleared from the dialog. The documented workaround was to edit extra.tag in Spoolman's own interface. Everything around the button already treated those spools as tagged. The Tag ID column renders whichever identifier is present, and the payload the button sends nulls both fields -- which both inventory modes honour: the built-in PATCH applies them through exclude_unset, and the Spoolman route keys its tag-removal branch off either field being explicitly null. Either identifier now enables it, and clearing still removes both.
This commit is contained in:
@@ -1128,10 +1128,17 @@ export function SpoolFormModal({
|
||||
<div className="flex gap-2 p-4 border-t border-bambu-dark-tertiary flex-shrink-0">
|
||||
{isEditing && (
|
||||
<div className="flex gap-2 mr-auto">
|
||||
{/* Either identifier counts as "tagged". A Bambu Lab spool is
|
||||
linked by its 32-char tray UUID and carries no tag_uid at all
|
||||
-- in Spoolman mode that is every Bambu spool, because
|
||||
_map_spoolman_spool splits extra.tag by length -- so gating on
|
||||
tag_uid alone left this permanently greyed out for them, while
|
||||
the Tag ID column beside it showed the UUID and the payload
|
||||
below already cleared both fields (#3109). */}
|
||||
<Button
|
||||
variant="secondary"
|
||||
onClick={() => deleteTagMutation.mutate()}
|
||||
disabled={isPending || !spool?.tag_uid}
|
||||
disabled={isPending || !(spool?.tag_uid || spool?.tray_uuid)}
|
||||
>
|
||||
<Tag className="w-4 h-4" />
|
||||
{t('inventory.clearRfid', 'Clear RFID Tag')}
|
||||
|
||||
Reference in New Issue
Block a user