1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +02:00

Mobile: Resolves #1044: Add create sub-notebook feature (#7728)

This commit is contained in:
Carlos 2023-02-08 22:34:29 +08:00 committed by GitHub
parent c90865c4d2
commit f5fc1f2f22
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 0 deletions

View File

@ -63,6 +63,10 @@ class FolderScreenComponent extends BaseScreenComponent {
async saveFolderButton_press() {
let folder = Object.assign({}, this.state.folder);
if (this.props.navigation.state.parentFolderId) {
folder.parent_id = this.props.navigation.state.parentFolderId;
}
try {
folder = await Folder.save(folder, { userSideValidation: true });
} catch (error) {

View File

@ -138,6 +138,19 @@ const SideMenuContentComponent = (props: Props) => {
'',
_('Notebook: %s', folder.title),
[
{
text: _('New sub-notebook'),
onPress: () => {
props.dispatch({ type: 'SIDE_MENU_CLOSE' });
props.dispatch({
type: 'NAV_GO',
routeName: 'Folder',
folderId: null,
parentFolderId: folder.id,
});
},
},
{
text: _('Rename'),
onPress: () => {