Skip to content

Clearing the logo field and clicking Embed shows an error instead of clearing the logo #2

Description

@heliogoodbye

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

  1. Open the Admin panel and navigate to the Team Display section.
  2. Set a logo for either team and click Apply. The logo appears in the overlay.
  3. Clear the Logo File field.
  4. Click Embed.
  5. 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

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions