1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-08-30 20:39:46 +02:00

Compare commits

...

1 Commits

Author SHA1 Message Date
Laurent Cozic
361ee7e3ee Mobile: Fixes #3022: Fix issue with action button disappearing in some contexts 2020-09-04 17:49:36 +01:00
3 changed files with 12 additions and 3 deletions

View File

@@ -93,7 +93,7 @@ class ActionButtonComponent extends React.Component {
} }
if (!buttonComps.length && !this.props.mainButton) { if (!buttonComps.length && !this.props.mainButton) {
return <ReactNativeActionButton style={{ display: 'none' }} />; return null;
} }
const mainButton = this.props.mainButton ? this.props.mainButton : {}; const mainButton = this.props.mainButton ? this.props.mainButton : {};

View File

@@ -227,9 +227,12 @@ class NotesScreenComponent extends BaseScreenComponent {
); );
} }
const addFolderNoteButtons = this.props.selectedFolderId && this.props.selectedFolderId != Folder.conflictFolderId(); let buttonFolderId = this.props.selectedFolderId != Folder.conflictFolderId() ? this.props.selectedFolderId : null;
if (!buttonFolderId) buttonFolderId = this.props.activeFolderId;
const addFolderNoteButtons = !!buttonFolderId;
const thisComp = this; const thisComp = this;
const actionButtonComp = this.props.noteSelectionEnabled || !this.props.visible ? null : <ActionButton addFolderNoteButtons={addFolderNoteButtons} parentFolderId={this.props.selectedFolderId}></ActionButton>; const actionButtonComp = this.props.noteSelectionEnabled || !this.props.visible ? null : <ActionButton addFolderNoteButtons={addFolderNoteButtons} parentFolderId={buttonFolderId}></ActionButton>;
return ( return (
<View style={rootStyle}> <View style={rootStyle}>
@@ -250,6 +253,7 @@ const NotesScreen = connect(state => {
return { return {
folders: state.folders, folders: state.folders,
tags: state.tags, tags: state.tags,
activeFolderId: state.settings.activeFolderId,
selectedFolderId: state.selectedFolderId, selectedFolderId: state.selectedFolderId,
selectedNoteIds: state.selectedNoteIds, selectedNoteIds: state.selectedNoteIds,
selectedTagId: state.selectedTagId, selectedTagId: state.selectedTagId,

View File

@@ -252,7 +252,12 @@ class Setting extends BaseModel {
'sync.maxConcurrentConnections': { value: 5, type: Setting.TYPE_INT, public: true, advanced: true, section: 'sync', label: () => _('Max concurrent connections'), minimum: 1, maximum: 20, step: 1 }, 'sync.maxConcurrentConnections': { value: 5, type: Setting.TYPE_INT, public: true, advanced: true, section: 'sync', label: () => _('Max concurrent connections'), minimum: 1, maximum: 20, step: 1 },
// The active folder ID is guaranteed to be valid as long as there's at least one
// existing folder, so it is a good default in contexts where there's no currently
// selected folder. It corresponds in general to the currently selected folder or
// to the last folder that was selected.
activeFolderId: { value: '', type: Setting.TYPE_STRING, public: false }, activeFolderId: { value: '', type: Setting.TYPE_STRING, public: false },
firstStart: { value: true, type: Setting.TYPE_BOOL, public: false }, firstStart: { value: true, type: Setting.TYPE_BOOL, public: false },
locale: { locale: {
value: defaultLocale(), value: defaultLocale(),