1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-07-16 00:14:34 +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

@ -0,0 +1,21 @@
import { _ } from '../../../locale';
import Folder from '../../../models/Folder';
import Setting from '../../../models/Setting';
import { FolderEntity } from '../../../services/database/types';
import { getTrashFolderId, itemIsInTrash } from '../../../services/trash';
const getEmptyFolderMessage = (folders: FolderEntity[], selectedFolderId: string|null) => {
if (selectedFolderId === getTrashFolderId()) {
return _('There are no notes in the trash folder.');
} else if (selectedFolderId && itemIsInTrash(Folder.byId(folders, selectedFolderId))) {
return _('This subfolder of the trash has no notes.');
}
if (Setting.value('appType') === 'desktop') {
return _('No notes in here. Create one by clicking on "New note".');
} else {
return _('There are currently no notes. Create one by clicking on the (+) button.');
}
};
export default getEmptyFolderMessage;