Skip to content

AI-native knowledge base & Evernote/Obsidian alternative with instant sync & native MCP. Free on Cloudflare or self-hosted via Docker.

Add notebook picker to mobile templates

yoma202dab015f71
diff --git a/apps/mobile/src/screens/WorkspaceScreen.tsx b/apps/mobile/src/screens/WorkspaceScreen.tsx
index 47aeddff..cfca8d2b 100644
--- a/apps/mobile/src/screens/WorkspaceScreen.tsx
+++ b/apps/mobile/src/screens/WorkspaceScreen.tsx
@@ -1716,7 +1716,14 @@ const TemplatesModal = ({
}) => {
const { client } = useSession();
const queryClient = useQueryClient();
- const targetNotebookId = activeNotebookId !== ALL_NOTES_ID ? activeNotebookId : notebooks[0]?.id ?? "";
+ const fallbackNotebookId = activeNotebookId !== ALL_NOTES_ID ? activeNotebookId : notebooks[0]?.id ?? "";
+ const [targetNotebookId, setTargetNotebookId] = useState(fallbackNotebookId);
+
+ useEffect(() => {
+ if (visible) {
+ setTargetNotebookId(fallbackNotebookId);
+ }
+ }, [fallbackNotebookId, visible]);
const createFromTemplateMutation = useMutation({
mutationFn: async (template: MemoTemplate) => {
@@ -1760,6 +1767,8 @@ const TemplatesModal = ({
<ScrollView contentContainerStyle={styles.editorForm}>
<Text style={styles.sectionSubtitle}>选择一个模板,直接创建新笔记。</Text>
+ <Text style={styles.label}>目标笔记本</Text>
+ <NotebookPicker notebooks={notebooks} onChange={setTargetNotebookId} selectedNotebookId={targetNotebookId || fallbackNotebookId} />
{!targetNotebookId ? (
<View style={styles.warningPanel}>
<Text style={styles.warningText}>当前无法创建笔记,请先创建可用笔记本。</Text>