Skip to content

Commit bb91fac

Browse files
committed
fix: save toast shows label count instead of undefined
1 parent 57bd627 commit bb91fac

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

public/index.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1006,7 +1006,8 @@ <h1>C-Bus Web</h1>
10061006
updateUndoRedoButtons();
10071007
}
10081008
render();
1009-
showToast('Saved (' + data.count + ' labels). HA Discovery will update shortly.');
1009+
var savedCount = data.count || Object.keys(mergedLabels).length;
1010+
showToast('Saved ' + savedCount + ' label' + (savedCount === 1 ? '' : 's') + '. HA Discovery will update shortly.');
10101011
} catch (e) {
10111012
showToast('Failed to save: ' + e.message, true);
10121013
}

0 commit comments

Comments
 (0)