@@ -6,14 +6,12 @@ import React, {
6
6
useEffect ,
7
7
} from "react" ;
8
8
import { useTheme } from "styled-components/native" ;
9
- import { ScrollView } from "react-native" ;
10
9
import { useFocusEffect } from "@react-navigation/native" ;
11
10
import AsyncStorage from "@react-native-async-storage/async-storage" ;
12
11
// Components
13
12
import Container from "components/Container" ;
14
13
import NoteBook from "components/NoteBook" ;
15
14
import CustomSafeArea from "components/CustomSafeArea" ;
16
- import BookLines from "components/BookLines" ;
17
15
// Utils
18
16
import { unescapeHtml } from "utils/functions" ;
19
17
import dayjs from "dayjs" ;
@@ -78,8 +76,6 @@ const DiaryScreen: React.FC<DiaryNavigationProps> = ({
78
76
( page : PageProps ) => page . id === params . activityPageId
79
77
) ;
80
78
81
- console . log ( "activityIndex = " , activityIndex ) ;
82
-
83
79
setBookPages ( [ ...pages , defaultPage ] ) ;
84
80
setPageNumber ( activityIndex === - 1 ? pages . length : activityIndex ) ;
85
81
@@ -106,12 +102,14 @@ const DiaryScreen: React.FC<DiaryNavigationProps> = ({
106
102
107
103
useEffect ( ( ) => {
108
104
if ( ! isEditorLoading ) {
109
- RichTextViewRef . current ?. setContentHTML (
110
- unescapeHtml ( currentPage . content )
111
- ) ;
105
+ setTimeout ( ( ) => {
106
+ RichTextViewRef . current ?. setContentHTML (
107
+ unescapeHtml ( currentPage . content )
108
+ ) ;
109
+ } , 50 ) ;
112
110
setEditorLoading ( false ) ;
113
111
}
114
- } , [ currentPage , isEditorLoading , RichTextViewRef , params . activityPageId ] ) ;
112
+ } , [ currentPage . content , isEditorLoading , RichTextViewRef ] ) ;
115
113
116
114
const onPrevPage = ( ) => {
117
115
const prevPage = pageNumber - 1 ;
0 commit comments