Skip to content

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

fix: issue with paths and strings

Ilian Sapundshiev2949c9e171ba
diff --git a/app/components/dialogs/CreateTagGroupDialog.tsx b/app/components/dialogs/CreateTagGroupDialog.tsx
index 8858c52d3..b76eca470 100644
--- a/app/components/dialogs/CreateTagGroupDialog.tsx
+++ b/app/components/dialogs/CreateTagGroupDialog.tsx
@@ -70,14 +70,16 @@ const CreateTagGroupDialog = (props: Props) => {
if (title.current.length > 0) {
if (inputError) {
setInputError(false);
- } else { // rerender
+ } else {
+ // rerender
forceUpdate();
}
disableConfirmButton.current = false;
} else {
if (!inputError) {
setInputError(true);
- } else { // rerender
+ } else {
+ // rerender
forceUpdate();
}
disableConfirmButton.current = true;
diff --git a/app/components/dialogs/ProTeaserDialog.tsx b/app/components/dialogs/ProTeaserDialog.tsx
index fb1512a9e..27a3f6179 100644
--- a/app/components/dialogs/ProTeaserDialog.tsx
+++ b/app/components/dialogs/ProTeaserDialog.tsx
@@ -407,10 +407,7 @@ const ProTeaserDialog = (props: Props) => {
 
<Button
onClick={() =>
- props.openURLExternally(
- AppConfig.links.emailContact,
- true
- )
+ props.openURLExternally(AppConfig.links.emailContact, true)
}
variant="outlined"
color="primary"
diff --git a/app/components/menus/LocationMenu.tsx b/app/components/menus/LocationMenu.tsx
index 806ad9bb3..9912754be 100644
--- a/app/components/menus/LocationMenu.tsx
+++ b/app/components/menus/LocationMenu.tsx
@@ -55,7 +55,7 @@ const LocationMenu = (props: Props) => {
let currentLocation;
if (props.currentLocationId && props.locations) {
currentLocation = props.locations.find(
- (location: Location) => location.uuid === props.currentLocationId
+ (location: Location) => location.uuid === props.currentLocationId
);
}
@@ -76,7 +76,7 @@ const LocationMenu = (props: Props) => {
<Button
data-tid="folderContainerLocationChooser"
id="locationMenuButton"
- onClick={(event) => setLocationChooserMenuAnchorEl(event.currentTarget)}
+ onClick={event => setLocationChooserMenuAnchorEl(event.currentTarget)}
title={currentLocation && currentLocation.name}
style={{ paddingRight: 0, paddingLeft: 11 }}
>
diff --git a/app/reducers/app.ts b/app/reducers/app.ts
index bdc5b0fa6..1e72b83f5 100644
--- a/app/reducers/app.ts
+++ b/app/reducers/app.ts
@@ -267,12 +267,10 @@ export default (state: any = initialState, action: any) => {
};
}
case types.LOAD_DIRECTORY_SUCCESS: {
- let directoryPath;
- if (action.directoryPath.startsWith('./')) {
+ let { directoryPath } = action;
+ if (directoryPath && directoryPath.startsWith('./')) {
// relative paths
- directoryPath = PlatformIO.resolveFilePath(action.directoryPath);
- } else {
- ({ directoryPath } = action);
+ directoryPath = PlatformIO.resolveFilePath(directoryPath);
}
return {
...state,