mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 23:19:40 +01:00
fixed synced component not showing
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import React, {useEffect, useState} from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import {
|
import {
|
||||||
ActivityIndicator,
|
ActivityIndicator,
|
||||||
Clipboard,
|
Clipboard,
|
||||||
@@ -6,49 +6,43 @@ import {
|
|||||||
Keyboard,
|
Keyboard,
|
||||||
ScrollView,
|
ScrollView,
|
||||||
TouchableOpacity,
|
TouchableOpacity,
|
||||||
View,
|
View
|
||||||
} from 'react-native';
|
} from 'react-native';
|
||||||
import Share from 'react-native-share';
|
import Share from 'react-native-share';
|
||||||
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
||||||
import {notesnook} from '../../../e2e/test.ids';
|
import { notesnook } from '../../../e2e/test.ids';
|
||||||
import {useTracked} from '../../provider';
|
import { useTracked } from '../../provider';
|
||||||
import {Actions} from '../../provider/Actions';
|
import { Actions } from '../../provider/Actions';
|
||||||
import {DDS} from '../../services/DeviceDetection';
|
import { DDS } from '../../services/DeviceDetection';
|
||||||
import {
|
import {
|
||||||
eSendEvent,
|
eSendEvent,
|
||||||
openVault,
|
openVault,
|
||||||
sendNoteEditedEvent,
|
sendNoteEditedEvent,
|
||||||
ToastEvent,
|
ToastEvent
|
||||||
} from '../../services/EventManager';
|
} from '../../services/EventManager';
|
||||||
import Navigation from '../../services/Navigation';
|
import Navigation from '../../services/Navigation';
|
||||||
import PremiumService from '../../services/PremiumService';
|
|
||||||
import Sync from '../../services/Sync';
|
import Sync from '../../services/Sync';
|
||||||
import {editing, toTXT} from '../../utils';
|
import { editing, toTXT } from '../../utils';
|
||||||
import {
|
import {
|
||||||
ACCENT,
|
ACCENT,
|
||||||
COLOR_SCHEME,
|
COLOR_SCHEME,
|
||||||
COLOR_SCHEME_DARK,
|
COLOR_SCHEME_DARK,
|
||||||
COLOR_SCHEME_LIGHT,
|
COLOR_SCHEME_LIGHT,
|
||||||
setColorScheme,
|
setColorScheme
|
||||||
} from '../../utils/Colors';
|
} from '../../utils/Colors';
|
||||||
import {db} from '../../utils/DB';
|
import { db } from '../../utils/DB';
|
||||||
import {
|
import {
|
||||||
eOnNewTopicAdded,
|
eOpenMoveNoteDialog
|
||||||
eOpenMoveNoteDialog,
|
|
||||||
refreshNotesPage,
|
|
||||||
} from '../../utils/Events';
|
} from '../../utils/Events';
|
||||||
import {deleteItems} from '../../utils/functions';
|
import { deleteItems } from '../../utils/functions';
|
||||||
import {MMKV} from '../../utils/mmkv';
|
import { MMKV } from '../../utils/mmkv';
|
||||||
import {opacity, pv, SIZE} from '../../utils/SizeUtils';
|
import { opacity, pv, SIZE } from '../../utils/SizeUtils';
|
||||||
import {sleep, timeConverter} from '../../utils/TimeUtils';
|
import { sleep, timeConverter } from '../../utils/TimeUtils';
|
||||||
import {ActionIcon} from '../ActionIcon';
|
import { PressableButton } from '../PressableButton';
|
||||||
import {PremiumTag} from '../Premium/PremiumTag';
|
|
||||||
import {PressableButton} from '../PressableButton';
|
|
||||||
import {Toast} from '../Toast';
|
|
||||||
import Heading from '../Typography/Heading';
|
import Heading from '../Typography/Heading';
|
||||||
import Paragraph from '../Typography/Paragraph';
|
import Paragraph from '../Typography/Paragraph';
|
||||||
import {ActionSheetColorsSection} from './ActionSheetColorsSection';
|
import { ActionSheetColorsSection } from './ActionSheetColorsSection';
|
||||||
import {ActionSheetTagsSection} from './ActionSheetTagsSection';
|
import { ActionSheetTagsSection } from './ActionSheetTagsSection';
|
||||||
const w = Dimensions.get('window').width;
|
const w = Dimensions.get('window').width;
|
||||||
|
|
||||||
export const ActionSheetComponent = ({
|
export const ActionSheetComponent = ({
|
||||||
@@ -61,7 +55,7 @@ export const ActionSheetComponent = ({
|
|||||||
getRef,
|
getRef,
|
||||||
}) => {
|
}) => {
|
||||||
const [state, dispatch] = useTracked();
|
const [state, dispatch] = useTracked();
|
||||||
const {colors, user} = state;
|
const {colors, user, lastSynced} = state;
|
||||||
const [refreshing, setRefreshing] = useState(false);
|
const [refreshing, setRefreshing] = useState(false);
|
||||||
const [isPinnedToMenu, setIsPinnedToMenu] = useState(false);
|
const [isPinnedToMenu, setIsPinnedToMenu] = useState(false);
|
||||||
const [note, setNote] = useState(item);
|
const [note, setNote] = useState(item);
|
||||||
@@ -570,11 +564,12 @@ export const ActionSheetComponent = ({
|
|||||||
paddingHorizontal: 12,
|
paddingHorizontal: 12,
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
marginTop: 5,
|
marginTop: 5,
|
||||||
zIndex:10
|
zIndex: 10,
|
||||||
}}>
|
}}>
|
||||||
<Heading
|
<Heading
|
||||||
style={{
|
style={{
|
||||||
maxWidth: '70%',
|
maxWidth: '90%',
|
||||||
|
textAlign: 'center',
|
||||||
}}
|
}}
|
||||||
size={SIZE.md}>
|
size={SIZE.md}>
|
||||||
{note?.title.replace('\n', '')}
|
{note?.title.replace('\n', '')}
|
||||||
@@ -584,9 +579,9 @@ export const ActionSheetComponent = ({
|
|||||||
<Paragraph
|
<Paragraph
|
||||||
numberOfLines={2}
|
numberOfLines={2}
|
||||||
style={{
|
style={{
|
||||||
width: '80%',
|
width: '90%',
|
||||||
textAlign: 'center',
|
textAlign: 'center',
|
||||||
maxWidth: '80%',
|
maxWidth: '90%',
|
||||||
}}>
|
}}>
|
||||||
{note.type === 'notebook' && note.description
|
{note.type === 'notebook' && note.description
|
||||||
? note.description
|
? note.description
|
||||||
@@ -682,9 +677,7 @@ export const ActionSheetComponent = ({
|
|||||||
textAlignVertical: 'center',
|
textAlignVertical: 'center',
|
||||||
textAlign: 'center',
|
textAlign: 'center',
|
||||||
}}>
|
}}>
|
||||||
{user && user.lastSynced && user.lastSynced > note.dateEdited
|
{user && lastSynced > note.dateEdited ? 'Synced' : 'Sync Now'}
|
||||||
? 'Synced'
|
|
||||||
: 'Sync Now'}
|
|
||||||
</Paragraph>
|
</Paragraph>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
)}
|
)}
|
||||||
@@ -797,10 +790,7 @@ export const ActionSheetComponent = ({
|
|||||||
<View>{columnItemsData.map(_renderColumnItem)}</View>
|
<View>{columnItemsData.map(_renderColumnItem)}</View>
|
||||||
) : null}
|
) : null}
|
||||||
|
|
||||||
{note.type === 'note' &&
|
{note.type === 'note' && user && lastSynced >= note.dateEdited ? (
|
||||||
user &&
|
|
||||||
user.lastSynced &&
|
|
||||||
user.lastSynced > note.dateEdited ? (
|
|
||||||
<PressableButton
|
<PressableButton
|
||||||
type="shade"
|
type="shade"
|
||||||
customStyle={{
|
customStyle={{
|
||||||
@@ -826,7 +816,7 @@ export const ActionSheetComponent = ({
|
|||||||
style={{
|
style={{
|
||||||
fontSize: SIZE.md,
|
fontSize: SIZE.md,
|
||||||
}}>
|
}}>
|
||||||
This note is encrypted & synced
|
This note is encrypted and synced
|
||||||
</Heading>
|
</Heading>
|
||||||
<Paragraph
|
<Paragraph
|
||||||
style={{
|
style={{
|
||||||
|
|||||||
Reference in New Issue
Block a user