1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-29 22:48:10 +02:00

Mobile,Desktop: Fixes #10191: Do not invite user to create new notes in the trash folder (#10356)

This commit is contained in:
Henry Heino
2024-04-25 05:34:32 -07:00
committed by GitHub
parent 6aca77a0ae
commit 65c47189f9
5 changed files with 31 additions and 5 deletions

View File

@@ -6,6 +6,7 @@ import { connect } from 'react-redux';
import { FlatList, Text, StyleSheet, Button, View } from 'react-native';
import { FolderEntity, NoteEntity } from '@joplin/lib/services/database/types';
import { AppState } from '../utils/types';
import getEmptyFolderMessage from '@joplin/lib/components/shared/NoteList/getEmptyFolderMessage';
import Folder from '@joplin/lib/models/Folder';
const { _ } = require('@joplin/lib/locale');
@@ -20,7 +21,7 @@ interface NoteListProps {
items: NoteEntity[];
folders: FolderEntity[];
noteSelectionEnabled?: boolean;
selectedFolderId?: string;
selectedFolderId: string|null;
}
class NoteListComponent extends Component<NoteListProps> {
@@ -102,8 +103,9 @@ class NoteListComponent extends Component<NoteListProps> {
</View>
);
} else {
const noItemMessage = _('There are currently no notes. Create one by clicking on the (+) button.');
return <Text style={this.styles().noItemMessage}>{noItemMessage}</Text>;
return <Text style={this.styles().noItemMessage}>
{getEmptyFolderMessage(this.props.folders, this.props.selectedFolderId)}
</Text>;
}
}
}
@@ -117,6 +119,7 @@ const NoteList = connect((state: AppState) => {
notesSource: state.notesSource,
themeId: state.settings.theme,
noteSelectionEnabled: state.noteSelectionEnabled,
selectedFolderId: state.selectedFolderId,
};
})(NoteListComponent);