mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 06:59:31 +01:00
fix login flow on refresh list
This commit is contained in:
@@ -1,28 +1,27 @@
|
|||||||
import React, {createRef, useState} from 'react';
|
import React, { createRef, useState } from 'react';
|
||||||
import {
|
import {
|
||||||
FlatList,
|
FlatList,
|
||||||
Platform,
|
Platform,
|
||||||
RefreshControl,
|
RefreshControl,
|
||||||
SectionList,
|
SectionList,
|
||||||
Text,
|
Text,
|
||||||
View,
|
View
|
||||||
} from 'react-native';
|
} from 'react-native';
|
||||||
import * as Animatable from 'react-native-animatable';
|
import * as Animatable from 'react-native-animatable';
|
||||||
import {useSafeArea} from 'react-native-safe-area-context';
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
||||||
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
||||||
import {SIZE, WEIGHT} from '../../common/common';
|
import { SIZE, WEIGHT } from '../../common/common';
|
||||||
import {useTracked} from '../../provider';
|
import { useTracked } from '../../provider';
|
||||||
import {ACTIONS} from '../../provider/actions';
|
import { ACTIONS } from '../../provider/actions';
|
||||||
import {eSendEvent} from '../../services/eventManager';
|
import { eSendEvent } from '../../services/eventManager';
|
||||||
import {
|
import {
|
||||||
eClearSearch,
|
eClearSearch,
|
||||||
eOpenLoginDialog,
|
eOpenLoginDialog,
|
||||||
eScrollEvent,
|
eScrollEvent
|
||||||
} from '../../services/events';
|
} from '../../services/events';
|
||||||
import NavigationService from '../../services/NavigationService';
|
import { db, ToastEvent } from '../../utils/utils';
|
||||||
import {db, DDS, ToastEvent} from '../../utils/utils';
|
import { PressableButton } from '../PressableButton';
|
||||||
import {PressableButton} from '../PressableButton';
|
import { PinnedItemList } from './PinnedItemList';
|
||||||
import {PinnedItemList} from './PinnedItemList';
|
|
||||||
const sectionListRef = createRef();
|
const sectionListRef = createRef();
|
||||||
|
|
||||||
const AnimatedFlatlist = Animatable.createAnimatableComponent(FlatList);
|
const AnimatedFlatlist = Animatable.createAnimatableComponent(FlatList);
|
||||||
@@ -46,7 +45,7 @@ const SimpleList = ({
|
|||||||
const {colors, selectionMode, user} = state;
|
const {colors, selectionMode, user} = state;
|
||||||
const searchResults = {...state.searchResults};
|
const searchResults = {...state.searchResults};
|
||||||
const [refreshing, setRefreshing] = useState(false);
|
const [refreshing, setRefreshing] = useState(false);
|
||||||
const insets = useSafeArea();
|
const insets = useSafeAreaInsets();
|
||||||
const _onScroll = (event) => {
|
const _onScroll = (event) => {
|
||||||
if (!event) return;
|
if (!event) return;
|
||||||
let y = event.nativeEvent.contentOffset.y;
|
let y = event.nativeEvent.contentOffset.y;
|
||||||
@@ -124,9 +123,7 @@ const SimpleList = ({
|
|||||||
'global',
|
'global',
|
||||||
5000,
|
5000,
|
||||||
() => {
|
() => {
|
||||||
NavigationService.navigate('Login', {
|
eSendEvent(eOpenLoginDialog);
|
||||||
root: true,
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
'Login',
|
'Login',
|
||||||
);
|
);
|
||||||
@@ -186,11 +183,7 @@ const SimpleList = ({
|
|||||||
{user || !data[0] || selectionMode ? null : (
|
{user || !data[0] || selectionMode ? null : (
|
||||||
<PressableButton
|
<PressableButton
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
DDS.isTab
|
eSendEvent(eOpenLoginDialog);
|
||||||
? eSendEvent(eOpenLoginDialog)
|
|
||||||
: NavigationService.navigate('Login', {
|
|
||||||
root: true,
|
|
||||||
});
|
|
||||||
}}
|
}}
|
||||||
color={colors.shade}
|
color={colors.shade}
|
||||||
selectedColor={colors.accent}
|
selectedColor={colors.accent}
|
||||||
|
|||||||
Reference in New Issue
Block a user