mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-01-10 08:57:36 +08:00
Set default folder when saving a forked notebook (#1767)
This commit is contained in:
parent
0f38c59662
commit
ae797040cd
1 changed files with 6 additions and 1 deletions
|
@ -52,7 +52,12 @@ defmodule LivebookWeb.SessionLive.PersistenceComponent do
|
|||
|> assign_new(:attrs, fn -> attrs end)
|
||||
|> assign_new(:new_attrs, fn -> attrs end)
|
||||
|> assign_new(:draft_file, fn ->
|
||||
file || Livebook.Config.local_file_system_home()
|
||||
file ||
|
||||
case assigns.session.origin do
|
||||
# If it's a forked notebook, default to the same folder
|
||||
{:file, file} -> FileSystem.File.containing_dir(file)
|
||||
_ -> Livebook.Config.local_file_system_home()
|
||||
end
|
||||
end)
|
||||
|> assign_new(:saved_file, fn -> file end)
|
||||
|
||||
|
|
Loading…
Reference in a new issue