Radish alpha
r
Radicle desktop app
Radicle
Git (anonymous pull)
Log in to clone via SSH
Avoid issue creation without title or description
Sebastian Martinez committed 1 year ago
commit 5f26f71b8630397497aa83fe15ad31d406600b00
parent ca4d9d13fde0503dabd591d0f6167d9a4da93bb5
2 files changed +6 -1
modified src/components/ExtendedTextarea.svelte
@@ -26,6 +26,7 @@
    body?: string;
    embeds?: Map<string, Embed>;
    submitInProgress?: boolean;
+
    disableSubmit?: boolean;
    disallowEmptyBody?: boolean;
    isValid?: () => boolean;
    preview?: boolean;
@@ -50,6 +51,7 @@
    body = $bindable(""),
    embeds = new Map(),
    submitInProgress = false,
+
    disableSubmit = false,
    disallowEmptyBody = false,
    isValid = () => true,
    stylePadding,
@@ -276,7 +278,7 @@
      </div>
    {/if}
    <div class="buttons">
-
      <OutlineButton variant="ghost" onclick={selectFiles}>
+
      <OutlineButton variant="ghost" onclick={selectFiles} disabled={preview}>
        <Icon name="attachment" />
        <span class="global-hide-on-small-desktop-down">Attach</span>
      </OutlineButton>
@@ -293,6 +295,7 @@
        variant="ghost"
        disabled={!isValid() ||
          submitInProgress ||
+
          disableSubmit ||
          (disallowEmptyBody && body.trim() === "")}
        onclick={submitFn}>
        <Icon name="checkmark" />
modified src/views/repo/CreateIssue.svelte
@@ -134,6 +134,8 @@
    </div>

    <ExtendedTextarea
+
      disableSubmit={title.trim() === ""}
+
      disallowEmptyBody
      submitCaption="Save"
      close={() => window.history.back()}
      submit={async ({ comment, embeds }) => {