fix(directory-explorer): declare shouldCreateSelection in finalizeSelection
The variable was referenced at line 484 (the single-target create branch) but never declared, so every non-clone add path (Add button, Cmd+Enter, Open in Finder, mobile add) threw a ReferenceError that surfaced as a 'Failed to select directory' toast. Add the missing local declaration matching the condition the original review intended: !isCloneMode && shouldCreateTarget && the target path equals the user-typed path.
This commit is contained in:
@@ -469,6 +469,7 @@ export const DirectoryExplorerDialog: React.FC<DirectoryExplorerDialogProps> = (
|
|||||||
|
|
||||||
setIsConfirming(true);
|
setIsConfirming(true);
|
||||||
try {
|
try {
|
||||||
|
const shouldCreateSelection = !isCloneMode && shouldCreateTarget && normalizeDirectoryPath(target) === normalizeDirectoryPath(targetPath);
|
||||||
if (isCloneMode) {
|
if (isCloneMode) {
|
||||||
const remoteUrl = cloneRemoteUrl.trim();
|
const remoteUrl = cloneRemoteUrl.trim();
|
||||||
if (!remoteUrl) {
|
if (!remoteUrl) {
|
||||||
|
|||||||
Reference in New Issue
Block a user