diff --git a/ReactNativeClient/android/app/build.gradle b/ReactNativeClient/android/app/build.gradle index 006a25ee3..58dade38d 100644 --- a/ReactNativeClient/android/app/build.gradle +++ b/ReactNativeClient/android/app/build.gradle @@ -90,8 +90,8 @@ android { applicationId "net.cozic.joplin" minSdkVersion 16 targetSdkVersion 22 - versionCode 8 - versionName "0.8.6" + versionCode 10 + versionName "0.8.8" ndk { abiFilters "armeabi-v7a", "x86" } diff --git a/ReactNativeClient/lib/components/screen-header.js b/ReactNativeClient/lib/components/screen-header.js index d2f3d58db..f432ec88f 100644 --- a/ReactNativeClient/lib/components/screen-header.js +++ b/ReactNativeClient/lib/components/screen-header.js @@ -76,13 +76,13 @@ class ScreenHeaderComponent extends Component { let title = 'title' in this.props && this.props.title !== null ? this.props.title : _(this.props.navState.routeName); return ( - + {title} this.menu_select(value)}> - + { menuOptionComponents } diff --git a/ReactNativeClient/lib/components/screens/notes.js b/ReactNativeClient/lib/components/screens/notes.js index 32e339ca6..90d101d8b 100644 --- a/ReactNativeClient/lib/components/screens/notes.js +++ b/ReactNativeClient/lib/components/screens/notes.js @@ -8,6 +8,7 @@ import { ScreenHeader } from 'lib/components/screen-header.js'; import { MenuOption, Text } from 'react-native-popup-menu'; import { _ } from 'lib/locale.js'; import { ActionButton } from 'lib/components/action-button.js'; +import DialogBox from 'react-native-dialogbox'; class NotesScreenComponent extends React.Component { @@ -16,6 +17,9 @@ class NotesScreenComponent extends React.Component { } deleteFolder_onPress(folderId) { + let ok = confirm(_('Delete notebook?')); + if (!ok) return; + Folder.delete(folderId).then(() => { this.props.dispatch({ type: 'Navigation/NAVIGATE', diff --git a/ReactNativeClient/lib/components/screens/status.js b/ReactNativeClient/lib/components/screens/status.js index 2489ac9f3..4bcba1e56 100644 --- a/ReactNativeClient/lib/components/screens/status.js +++ b/ReactNativeClient/lib/components/screens/status.js @@ -7,6 +7,7 @@ import { ScreenHeader } from 'lib/components/screen-header.js'; import { time } from 'lib/time-utils' import { Logger } from 'lib/logger.js'; import { BaseItem } from 'lib/models/base-item.js'; +import { Folder } from 'lib/models/folder.js'; import { _ } from 'lib/locale.js'; class StatusScreenComponent extends React.Component { @@ -18,7 +19,7 @@ class StatusScreenComponent extends React.Component { constructor() { super(); this.state = { - report: {}, + reportLines: [], }; } @@ -26,15 +27,11 @@ class StatusScreenComponent extends React.Component { this.resfreshScreen(); } - resfreshScreen() { - return BaseItem.stats().then((report) => { - this.setState({ report: report }); - }); - } - - render() { + async resfreshScreen() { + let r = await BaseItem.stats(); let reportLines = []; - const r = this.state.report; + + reportLines.push(_('Sync status (sync items / total items):')); for (let n in r.items) { if (!r.items.hasOwnProperty(n)) continue; @@ -44,12 +41,26 @@ class StatusScreenComponent extends React.Component { if (r.total) reportLines.push(_('Total: %d/%d', r.total.synced, r.total.total)); if (r.toDelete) reportLines.push(_('To delete: %d', r.toDelete.total)); - reportLines = reportLines.join("\n"); + reportLines.push(''); + + reportLines.push(_('Folders:')); + + let folders = await Folder.all(); + for (let i = 0; i < folders.length; i++) { + let folder = folders[i]; + reportLines.push(_('%s: %d notes', folders[i].title, await Folder.noteCount(folders[i].id))); + } + + this.setState({ reportLines: reportLines }); + } + + render() { + let report = this.state.reportLines ? this.state.reportLines.join("\n") : ''; return ( - {reportLines} + {report}