mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-16 11:47:54 +01:00
mobile: fix crash on moving notebook when no notebooks selected
This commit is contained in:
@@ -197,16 +197,6 @@ export const SelectionHeader = React.memo(
|
||||
}
|
||||
]
|
||||
: [
|
||||
{
|
||||
title: strings.move(),
|
||||
onPress: async () => {
|
||||
const ids = selectedItemsList;
|
||||
const notebooks = await db.notebooks.all.items(ids);
|
||||
MoveNotebook.present(notebooks);
|
||||
},
|
||||
visible: renderedInRoute === "Notebooks",
|
||||
icon: "arrow-right-bold-box-outline"
|
||||
},
|
||||
{
|
||||
title: strings.manageTags(),
|
||||
onPress: async () => {
|
||||
|
||||
@@ -211,6 +211,14 @@ const TabBar = (
|
||||
const ids = useSideMenuNotebookSelectionStore
|
||||
.getState()
|
||||
.getSelectedItemIds();
|
||||
if (!ids.length) {
|
||||
ToastManager.show({
|
||||
context: "local",
|
||||
type: "error",
|
||||
message: strings.noNotebooksSelectedToMove()
|
||||
});
|
||||
return;
|
||||
}
|
||||
const notebooks = await db.notebooks.all.items(ids);
|
||||
Navigation.navigate("MoveNotebook", {
|
||||
selectedNotebooks: notebooks
|
||||
|
||||
@@ -6,6 +6,12 @@ msgstr ""
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Generator: @lingui/cli\n"
|
||||
"Language: en\n"
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"PO-Revision-Date: \n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: \n"
|
||||
"Plural-Forms: \n"
|
||||
|
||||
#: src/strings.ts:2410
|
||||
msgid " \"Notebook > Notes\""
|
||||
@@ -3946,6 +3952,10 @@ msgstr "No links found"
|
||||
msgid "No note history available for this device."
|
||||
msgstr "No note history available for this device."
|
||||
|
||||
#: src/strings.ts:2489
|
||||
msgid "No notebooks selected to move"
|
||||
msgstr "No notebooks selected to move"
|
||||
|
||||
#: src/strings.ts:202
|
||||
msgid "No one can view this {type} except you."
|
||||
msgstr "No one can view this {type} except you."
|
||||
|
||||
@@ -6,6 +6,12 @@ msgstr ""
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Generator: @lingui/cli\n"
|
||||
"Language: pseudo-LOCALE\n"
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"PO-Revision-Date: \n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: \n"
|
||||
"Plural-Forms: \n"
|
||||
|
||||
#: src/strings.ts:2410
|
||||
msgid " \"Notebook > Notes\""
|
||||
@@ -3926,6 +3932,10 @@ msgstr ""
|
||||
msgid "No note history available for this device."
|
||||
msgstr ""
|
||||
|
||||
#: src/strings.ts:2489
|
||||
msgid "No notebooks selected to move"
|
||||
msgstr ""
|
||||
|
||||
#: src/strings.ts:202
|
||||
msgid "No one can view this {type} except you."
|
||||
msgstr ""
|
||||
|
||||
@@ -2485,5 +2485,6 @@ Use this if changes from other devices are not appearing on this device. This wi
|
||||
yourArchiveIsEmpty: () => t`Your archive is empty`,
|
||||
unarchive: () => t`Unarchive`,
|
||||
moveNotebookDesc: () =>
|
||||
t`Select a notebook to move this notebook into, or unselect to move it to the root level.`
|
||||
t`Select a notebook to move this notebook into, or unselect to move it to the root level.`,
|
||||
noNotebooksSelectedToMove: () => t`No notebooks selected to move`
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user