Skip to content

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

Guard mobile create modals while saving

yomaf44ab04111d1
diff --git a/apps/mobile/src/screens/WorkspaceScreen.tsx b/apps/mobile/src/screens/WorkspaceScreen.tsx
index 0298660f..a0eac920 100644
--- a/apps/mobile/src/screens/WorkspaceScreen.tsx
+++ b/apps/mobile/src/screens/WorkspaceScreen.tsx
@@ -1943,11 +1943,11 @@ const CreateMemoModal = ({
};
return (
- <Modal animationType="slide" onRequestClose={onClose} presentationStyle="pageSheet" visible={visible}>
+ <Modal animationType="slide" onRequestClose={() => !createMutation.isPending && onClose()} presentationStyle="pageSheet" visible={visible}>
<SafeAreaView style={styles.modalSafeArea}>
<View style={styles.modalHeader}>
- <IconButton onPress={onClose}>
- <X color="#0f172a" size={20} />
+ <IconButton disabled={createMutation.isPending} onPress={onClose}>
+ <X color={createMutation.isPending ? "#cbd5e1" : "#0f172a"} size={20} />
</IconButton>
<Text style={styles.modalTitle}>新建笔记</Text>
<IconButton onPress={() => createMutation.mutate()}>
@@ -2051,11 +2051,11 @@ const TemplatesModal = ({
});
return (
- <Modal animationType="slide" onRequestClose={onClose} presentationStyle="pageSheet" visible={visible}>
+ <Modal animationType="slide" onRequestClose={() => !createFromTemplateMutation.isPending && onClose()} presentationStyle="pageSheet" visible={visible}>
<SafeAreaView style={styles.modalSafeArea}>
<View style={styles.modalHeader}>
- <IconButton onPress={onClose}>
- <X color="#0f172a" size={20} />
+ <IconButton disabled={createFromTemplateMutation.isPending} onPress={onClose}>
+ <X color={createFromTemplateMutation.isPending ? "#cbd5e1" : "#0f172a"} size={20} />
</IconButton>
<Text style={styles.modalTitle}>模板</Text>
<View style={styles.iconButtonPlaceholder} />