Skip to content

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

fixing broken rename directory dialog

Ilian Sapundshiev935c9b7a2f4e
diff --git a/app/components/dialogs/RenameDirectoryDialog.js b/app/components/dialogs/RenameDirectoryDialog.js
index 34828c6f8..1a7966309 100644
--- a/app/components/dialogs/RenameDirectoryDialog.js
+++ b/app/components/dialogs/RenameDirectoryDialog.js
@@ -49,18 +49,9 @@ class RenameDirectoryDialog extends React.Component<Props, State> {
state = {
inputError: false,
disableConfirmButton: true,
- name: '',
+ name: this.props.selectedDirectoryPath ? extractDirectoryName(this.props.selectedDirectoryPath) : '',
};
- static getDerivedStateFromProps(props) {
- if (props.open) {
- return {
- name: extractDirectoryName(props.selectedDirectoryPath)
- };
- }
- return null;
- }
-
handleInputChange = (event: Object) => {
const target = event.target;
const value = target.type === 'checkbox' ? target.checked : target.value;