Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

mobile: fix topic sheet snaps to top in topics screen

ammarahm-ed4de4693505bc
diff --git a/apps/mobile/app/components/sheets/topic-sheet/index.tsx b/apps/mobile/app/components/sheets/topic-sheet/index.tsx
index 72242cd6f..1157b29c7 100644
--- a/apps/mobile/app/components/sheets/topic-sheet/index.tsx
+++ b/apps/mobile/app/components/sheets/topic-sheet/index.tsx
@@ -205,16 +205,15 @@ export const TopicsSheet = () => {
if (canShow) {
const id = isTopic ? currentScreen?.notebookId : currentScreen?.id;
const notebook = db.notebooks?.notebook(id as string)?.data;
- const snapPoint = TopicSheetConfig.get({
- type: isTopic ? "topic" : "notebook",
- id: currentScreen.id as string
- });
+ const snapPoint = isTopic
+ ? 0
+ : TopicSheetConfig.get({
+ type: isTopic ? "topic" : "notebook",
+ id: currentScreen.id as string
+ });
+
if (ref.current?.isOpen()) {
- if (!isTopic) {
- ref.current?.snapToIndex(snapPoint);
- } else {
- ref.current?.snapToIndex(0);
- }
+ ref.current?.snapToIndex(snapPoint);
} else {
ref.current?.show(snapPoint);
}