Skip to content

Commit

Permalink
Let active target toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
stefba committed May 18, 2024
1 parent 920f296 commit 252d743
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/parts/nav/nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { extendedBase, section, isFile } from 'funcs/paths';
import { TargetsContext, TargetsProps } from 'context/targets';
//import { ErrContext } from 'context/err';
import File from 'funcs/files';
import { setActiveTarget, removeTarget } from 'funcs/targets';
import { setActiveTarget, removeTarget, unsetActiveTarget } from 'funcs/targets';
import { ErrComponent } from 'parts/nav/error';
import Config from 'config';
import { ErrContext } from 'context/err';
Expand Down Expand Up @@ -67,6 +67,10 @@ export default function Nav({path}: NavProps) {
alert("Cannot make file active dir.")
return;
}
if (isActiveTarget(targets, path)) {
saveTargets(unsetActiveTarget(targets));
return;
}
saveTargets(setActiveTarget(targets, path));
}

Expand Down

0 comments on commit 252d743

Please sign in to comment.