Skip to content

Commit

Permalink
manual perspective priority changes
Browse files Browse the repository at this point in the history
  • Loading branch information
sytolk committed Jan 29, 2024
1 parent 4519f10 commit 66716c7
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/renderer/hooks/DirectoryContentContextProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -228,12 +228,14 @@ export const DirectoryContentContextProvider = ({

useEffect(() => {
if (currentLocation) {
// check for relative path for Location
getLocationPath(currentLocation).then((locationPath) => {
currentLocationPath.current = locationPath;
if (!skipInitialDirList) {
return openDirectory(locationPath);
}
});
manualPerspective.current = 'unspecified';
} else {
currentLocationPath.current = '';
clearDirectoryContent();
Expand Down Expand Up @@ -777,13 +779,13 @@ export const DirectoryContentContextProvider = ({
);

function getPerspective(): TS.PerspectiveType {
if (currentPerspective.current === 'unspecified') {
if (manualPerspective.current === 'unspecified') {
if (manualPerspective.current === 'unspecified') {
if (currentPerspective.current === 'unspecified') {
return defaultPerspective;
}
return manualPerspective.current;
return currentPerspective.current;
}
return currentPerspective.current;
return manualPerspective.current;
}

function setDirectoryPerspective(
Expand All @@ -793,7 +795,8 @@ export const DirectoryContentContextProvider = ({
reload: boolean = true,
): Promise<TS.FileSystemEntryMeta | null> {
return new Promise((resolve) => {
if (isManual && currentPerspective.current === 'unspecified') {
if (isManual) {
//&& currentPerspective.current === 'unspecified') {
manualPerspective.current = perspective;
resolve(null);
} else {
Expand Down

0 comments on commit 66716c7

Please sign in to comment.