From 10b975bf625febf26687c0fb574287eb2ca5e23b Mon Sep 17 00:00:00 2001 From: ammarahm-ed Date: Tue, 4 Jan 2022 10:11:29 +0500 Subject: [PATCH] do not show sync complete toast --- apps/mobile/src/components/SimpleList/index.js | 11 +++++++++-- apps/mobile/src/services/Sync.js | 6 ------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/apps/mobile/src/components/SimpleList/index.js b/apps/mobile/src/components/SimpleList/index.js index 63d452c82..f0183411e 100644 --- a/apps/mobile/src/components/SimpleList/index.js +++ b/apps/mobile/src/components/SimpleList/index.js @@ -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={ diff --git a/apps/mobile/src/services/Sync.js b/apps/mobile/src/services/Sync.js index d129abb32..5380b5f00 100644 --- a/apps/mobile/src/services/Sync.js +++ b/apps/mobile/src/services/Sync.js @@ -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) {