Skip to content

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

flow fixes

Mladen Sapundshiev9345c5ebba1f
diff --git a/app/components/FolderContainer.js b/app/components/FolderContainer.js
index 534267f8e..4e038a2af 100644
--- a/app/components/FolderContainer.js
+++ b/app/components/FolderContainer.js
@@ -129,7 +129,6 @@ type Props = {
classes: Object,
windowHeight: number,
windowWidth: number,
- locations: Array<Location>,
directoryContent: Array<Object>,
currentLocationId: string | null,
currentDirectoryPath: string | null,
@@ -174,7 +173,7 @@ type State = {
class FolderContainer extends React.Component<Props, State> {
state = {
- currentPerspective: '',
+ currentPerspective: 'grid',
isPropertiesPanelVisible: false,
isDirectoryMenuOpened: false,
locationChooserMenuOpened: false,
@@ -187,26 +186,6 @@ class FolderContainer extends React.Component<Props, State> {
perspectiveCommand: {}
};
- componentWillReceiveProps = (nextProps: Props) => {
- if (nextProps.currentLocationId != null) {
- this.props.locations.map((location: Location) => {
- if (location.uuid === nextProps.currentLocationId) {
- this.setState({
- currentLocation: location,
- currentPerspective: 'grid' // TODO for removing
- });
- }
- return true;
- });
- } else {
- // closing the perspective
- this.setState({
- currentLocation: undefined,
- currentPerspective: undefined
- });
- }
- };
-
keyBindingHandlers = {
openParentDirectory: this.props.loadParentDirectoryContent,
nextDocument: () => {
@@ -349,7 +328,6 @@ class FolderContainer extends React.Component<Props, State> {
}
return (
<WelcomePanel
- locations={this.props.locations}
openLocation={this.props.openLocation}
/>
);
@@ -368,6 +346,7 @@ class FolderContainer extends React.Component<Props, State> {
openLocation={this.props.openLocation}
toggleLocationChooser={this.toggleLocationChooser}
menuAnchorEl={this.state.locationChooserMenuAnchorEl}
+ currentLocationId={this.props.currentLocationId}
/>
<div className={classes.flexMiddle} data-tid="entriesFound">
{this.props.searchResultCount > 0 && (
diff --git a/app/components/LocationMenu.js b/app/components/LocationMenu.js
index 3634597eb..ebc59f54e 100644
--- a/app/components/LocationMenu.js
+++ b/app/components/LocationMenu.js
@@ -37,21 +37,31 @@ import {
type Props = {
classes: Object,
- currentLocationId: string | null
+ currentLocationId: string | null,
+ locations: Array<Location>,
+ openLocation: (path: string) => void,
+ toggleLocationChooser: (event?: Object) => void,
+ menuAnchorEl: null | Object
};
type State = {
- currentLocation?: Location
+ currentLocation?: Location,
+ locationChooserMenuOpened: boolean,
+ locationChooserMenuAnchorEl: null | Object
};
-class LocationMenu extends React.Component { // <Props, State> {
+class LocationMenu extends React.Component <Props, State> {
+ state = {
+ locationChooserMenuOpened: false,
+ locationChooserMenuAnchorEl: null,
+ }
+
componentWillReceiveProps = (nextProps: Props) => {
if (nextProps.currentLocationId != null) {
this.props.locations.map((location: Location) => {
if (location.uuid === nextProps.currentLocationId) {
this.setState({
currentLocation: location,
- currentPerspective: 'grid' // TODO for removing
});
}
return true;
@@ -60,7 +70,6 @@ class LocationMenu extends React.Component { // <Props, State> {
// closing the perspective
this.setState({
currentLocation: undefined,
- currentPerspective: undefined
});
}
};