Skip to content

TagSpaces is an offline, open source, document manager with tagging support

fix tab switch

sytolk971970a1d75f
diff --git a/app/components/EntryContainerTabs.tsx b/app/components/EntryContainerTabs.tsx
index 0b0b596c6..08f2bc850 100644
--- a/app/components/EntryContainerTabs.tsx
+++ b/app/components/EntryContainerTabs.tsx
@@ -125,7 +125,6 @@ function EntryContainerTabs(props: EntryContainerTabsProps) {
const tileServer = useSelector(getMapTileServer);
const desktopMode = useSelector(isDesktopMode);
const dispatch: AppDispatch = useDispatch();
- const previousTab = useRef<number>(undefined);
function TsTabPanel(tprops: TabPanelProps) {
const { children, value, index, ...other } = tprops;
@@ -156,23 +155,19 @@ function EntryContainerTabs(props: EntryContainerTabsProps) {
dispatch(AppActions.renameFile(filePath, newFilePath));
const handleChange = (event: React.SyntheticEvent, newValue: number) => {
- previousTab.current = tabIndex;
dispatch(SettingsActions.setEntryContainerTab(newValue));
openPanel();
- // console.error('tab changed to:' + newValue);
+ console.error('tab changed to:' + newValue);
};
const handleTabClick = (event: React.SyntheticEvent) => {
if (
openedFile.isFile &&
- previousTab.current === tabIndex &&
tabIndex === parseInt(event.currentTarget.id.split('-')[1], 10)
) {
// when selected tab is clicked...
dispatch(SettingsActions.setEntryContainerTab(undefined));
toggleProperties();
- // console.error('tab click:' + tabIndex);
- } else {
- previousTab.current = tabIndex;
+ console.error('tab click:' + tabIndex);
}
};