Skip to content

Commit

Permalink
Merge pull request #136 from tinloof:tin-2762-folder-overrides-initia…
Browse files Browse the repository at this point in the history
…l-value

initial value over current folder
  • Loading branch information
stilyan-tinloof authored Feb 10, 2025
2 parents 50c9a9e + 671f87b commit c885f43
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/proud-spies-smoke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@tinloof/sanity-studio": patch
---

Pioritise document initial value over current folder
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,12 @@ function getPathname({
currentDir: string;
initialValue: string | undefined;
}) {
if (currentDir) {
return `${currentDir}/`;
if (initialValue !== undefined) {
return initialValue;
}

if (initialValue) {
return initialValue;
if (currentDir) {
return `${currentDir}/`;
}

return "/";
Expand Down

0 comments on commit c885f43

Please sign in to comment.