do not show sync complete toast

This commit is contained in:
ammarahm-ed
2022-01-04 10:11:29 +05:00
parent 3ba217e73b
commit 10b975bf62
2 changed files with 9 additions and 8 deletions

View File

@@ -1,7 +1,13 @@
import React, {useEffect, useRef, useState} from 'react';
import {FlatList, RefreshControl, RefreshControlComponent, View} from 'react-native';
import {
FlatList,
RefreshControl,
RefreshControlComponent,
View
} from 'react-native';
import {notesnook} from '../../../e2e/test.ids';
import {useTracked} from '../../provider';
import {useUserStore} from '../../provider/stores';
import {eSendEvent} from '../../services/EventManager';
import Sync from '../../services/Sync';
import {db} from '../../utils/database';
@@ -76,6 +82,7 @@ const SimpleList = ({
const [_loading, _setLoading] = useState(true);
//const refreshing = false;
const [refreshing, setRefreshing] = useState(false);
const syncing = useUserStore(state => state.syncing);
useEffect(() => {
let timeout = null;
@@ -158,7 +165,7 @@ const SimpleList = ({
tintColor={colors.accent}
colors={[colors.accent]}
onRefresh={_onRefresh}
refreshing={refreshing}
refreshing={refreshing || syncing}
/>
}
ListEmptyComponent={

View File

@@ -32,12 +32,6 @@ const run = async (context = 'global', forced) => {
if (typeof res === 'string') throw new Error(res);
retryCount = 0;
result = true;
ToastEvent.show({
heading: 'Sync complete',
type: 'success',
message: 'All your notes are encrypted and synced!',
context: context
});
} catch (e) {
result = false;
if (e.message !== 'Sync already running' && userstore.user) {