mirror of
https://github.com/laurent22/joplin.git
synced 2025-02-01 19:15:01 +02:00
This commit is contained in:
parent
04298f0eba
commit
b9eb4522f5
@ -16,6 +16,7 @@ import { reg } from '@joplin/lib/registry';
|
|||||||
import { ProfileConfig } from '@joplin/lib/services/profileConfig/types';
|
import { ProfileConfig } from '@joplin/lib/services/profileConfig/types';
|
||||||
import { getTrashFolderIcon, getTrashFolderId } from '@joplin/lib/services/trash';
|
import { getTrashFolderIcon, getTrashFolderId } from '@joplin/lib/services/trash';
|
||||||
import restoreItems from '@joplin/lib/services/trash/restoreItems';
|
import restoreItems from '@joplin/lib/services/trash/restoreItems';
|
||||||
|
import emptyTrash from '@joplin/lib/services/trash/emptyTrash';
|
||||||
import { ModelType } from '@joplin/lib/BaseModel';
|
import { ModelType } from '@joplin/lib/BaseModel';
|
||||||
const { substrWithEllipsis } = require('@joplin/lib/string-utils');
|
const { substrWithEllipsis } = require('@joplin/lib/string-utils');
|
||||||
|
|
||||||
@ -146,11 +147,30 @@ const SideMenuContentComponent = (props: Props) => {
|
|||||||
|
|
||||||
const folder = folderOrAll as FolderEntity;
|
const folder = folderOrAll as FolderEntity;
|
||||||
|
|
||||||
if (folder && folder.id === getTrashFolderId()) return;
|
|
||||||
|
|
||||||
const menuItems: any[] = [];
|
const menuItems: any[] = [];
|
||||||
|
|
||||||
if (folder && !!folder.deleted_time) {
|
if (folder && folder.id === getTrashFolderId()) {
|
||||||
|
menuItems.push({
|
||||||
|
text: _('Empty trash'),
|
||||||
|
onPress: async () => {
|
||||||
|
Alert.alert('', _('This will permanently delete all items in the trash. Continue?'), [
|
||||||
|
{
|
||||||
|
text: _('Empty trash'),
|
||||||
|
onPress: async () => {
|
||||||
|
await emptyTrash();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: _('Cancel'),
|
||||||
|
onPress: () => { },
|
||||||
|
style: 'cancel',
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
},
|
||||||
|
style: 'destructive',
|
||||||
|
});
|
||||||
|
|
||||||
|
} else if (folder && !!folder.deleted_time) {
|
||||||
menuItems.push({
|
menuItems.push({
|
||||||
text: _('Restore'),
|
text: _('Restore'),
|
||||||
onPress: async () => {
|
onPress: async () => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user