mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-01-31 03:07:53 +08:00
Enable image upload field when no name provided. Use image name as default value. (#1083)
This commit is contained in:
parent
32aeec2cc5
commit
00c913adcc
1 changed files with 2 additions and 2 deletions
|
@ -56,7 +56,7 @@ defmodule LivebookWeb.SessionLive.CellUploadComponent do
|
|||
<%= live_patch "Cancel", to: @return_to, class: "button-base button-outlined-gray" %>
|
||||
<button class="button-base button-blue"
|
||||
type="submit"
|
||||
disabled={@uploads.cell_image.entries == [] or @name == ""}>
|
||||
disabled={@uploads.cell_image.entries == []}>
|
||||
Upload
|
||||
</button>
|
||||
</div>
|
||||
|
@ -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 =
|
||||
|
|
Loading…
Reference in a new issue