In the Admin panel's Team Display section, clearing the Logo File field and clicking Embed shows "Enter a URL or path first." instead of removing the logo from the overlay.
ltsEmbedLogo in admin/index.html treats an empty field as an error condition. It was written only to handle converting a URL or path to a base64 data URL, and has no code path for the empty-field case. Clearing the field and clicking Embed is a reasonable way to signal that the logo should be removed, but the function returns early with an error before any clearing logic could run.
Steps to reproduce
- Open the Admin panel and navigate to the Team Display section.
- Set a logo for either team and click Apply. The logo appears in the overlay.
- Clear the Logo File field.
- Click Embed.
- The status shows "Enter a URL or path first." in red. The logo remains in the overlay.
Expected behavior
Clearing the field and clicking Embed should remove the logo from the overlay, clearing the saved value from localStorage and pushing an empty value to CRG.
Actual behavior
The function returns early with an error. The logo is not cleared.
Suggested fix
In ltsEmbedLogo, handle the empty case before the error guard:
if (!url) {
input.value = '';
// clear from localStorage and push empty value to CRG
// (same mechanism used by the Apply button for other fields)
setStatus('Logo cleared. Click Apply to save.', '#888');
return;
}
Alternatively, the Apply button could treat an empty logo field as a clear instruction on its own, which would make Embed unnecessary for this use case.
Environment
- TMSB version: v2.0.0-beta.1
In the Admin panel's Team Display section, clearing the Logo File field and clicking Embed shows "Enter a URL or path first." instead of removing the logo from the overlay.
ltsEmbedLogoinadmin/index.htmltreats an empty field as an error condition. It was written only to handle converting a URL or path to a base64 data URL, and has no code path for the empty-field case. Clearing the field and clicking Embed is a reasonable way to signal that the logo should be removed, but the function returns early with an error before any clearing logic could run.Steps to reproduce
Expected behavior
Clearing the field and clicking Embed should remove the logo from the overlay, clearing the saved value from
localStorageand pushing an empty value to CRG.Actual behavior
The function returns early with an error. The logo is not cleared.
Suggested fix
In
ltsEmbedLogo, handle the empty case before the error guard:Alternatively, the Apply button could treat an empty logo field as a clear instruction on its own, which would make Embed unnecessary for this use case.
Environment