Skip to content

Composer: a poll and attachments can coexist — hide Poll when media is attached #345

Description

@dmnyc

From the review of #341.

Nothing prevents attaching images and then tapping Poll: the Poll button hides for replies (pollAdd.classList.toggle('hidden', … || !!replyTo)) but not when draft.media is non-empty, and adding a poll does not clear media. doPublish pushes imetaTagsForMedia(draft.media) before the asPoll branch, so the result is a kind:1068 whose content carries appended image URLs and imeta tags — a shape the code comment near the tag push explicitly claims cannot arrive, and one no NIP-88 client renders.

Fix shape: the reply guard's pattern — hide the Poll button when draft.media.length is non-empty (and vice versa is already fine: attaching to an open poll draft should either be refused or close the poll). Decide which direction wins; a poll's body is its question, so media yielding to the poll is the natural reading.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions