From 00c913adcc1d29a1491f6617f918fa3f76826e70 Mon Sep 17 00:00:00 2001 From: Brooklin Myers Date: Fri, 1 Apr 2022 16:19:17 -0700 Subject: [PATCH] Enable image upload field when no name provided. Use image name as default value. (#1083) --- lib/livebook_web/live/session_live/cell_upload_component.ex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/livebook_web/live/session_live/cell_upload_component.ex b/lib/livebook_web/live/session_live/cell_upload_component.ex index 320b32a8f..55a00d969 100644 --- a/lib/livebook_web/live/session_live/cell_upload_component.ex +++ b/lib/livebook_web/live/session_live/cell_upload_component.ex @@ -56,7 +56,7 @@ defmodule LivebookWeb.SessionLive.CellUploadComponent do <%= live_patch "Cancel", to: @return_to, class: "button-base button-outlined-gray" %> @@ -79,7 +79,7 @@ defmodule LivebookWeb.SessionLive.CellUploadComponent do path = Path.expand(path) upload_file = FileSystem.File.local(path) ext = Path.extname(entry.client_name) - filename = name <> ext + filename = if name == "", do: entry.client_name, else: name <> ext destination_file = FileSystem.File.resolve(images_dir, filename) result =