Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

implement new tag api

ammarahm-ed17060b813f86
diff --git a/apps/mobile/src/components/Menu/index.js b/apps/mobile/src/components/Menu/index.js
index 147061b67..a28c9ac76 100644
--- a/apps/mobile/src/components/Menu/index.js
+++ b/apps/mobile/src/components/Menu/index.js
@@ -301,7 +301,7 @@ export const Menu = ({
marginBottom: 0,
}}>
{tags
- .filter(o => o.count > 1)
+ .filter(o => o.noteIds.length > 1)
.slice(0, tags.length > 10 ? 10 : tags.length)
.map(item => (
<TouchableOpacity
@@ -342,7 +342,7 @@ export const Menu = ({
}}>
{item.title + ' '}
</Text>
- {item.count > 1 ? (
+ {item.noteIds.length > 1 ? (
<Text
style={{
color: 'white',
@@ -355,7 +355,7 @@ export const Menu = ({
padding: 0,
paddingHorizontal: 1,
}}>
- {item.count > 99 ? '99+' : item.count}
+ {item.noteIds.length > 99 ? '99+' : item.noteIds.length}
</Text>
) : null}
</TouchableOpacity>
diff --git a/apps/mobile/src/components/SimpleList/index.js b/apps/mobile/src/components/SimpleList/index.js
index 224f5ad08..c22c68af9 100644
--- a/apps/mobile/src/components/SimpleList/index.js
+++ b/apps/mobile/src/components/SimpleList/index.js
@@ -181,7 +181,7 @@ const SimpleList = ({
);
const _listKeyExtractor = (item, index) =>
- item.dateCreated.toString() + index.toString();
+ item.id.toString() + index.toString();
return (
<FlatList
diff --git a/apps/mobile/src/views/Tags/index.js b/apps/mobile/src/views/Tags/index.js
index 9e035bf91..a200fd9cf 100644
--- a/apps/mobile/src/views/Tags/index.js
+++ b/apps/mobile/src/views/Tags/index.js
@@ -8,6 +8,7 @@ import SimpleList from '../../components/SimpleList';
import {useTracked} from '../../provider';
import {ACTIONS} from '../../provider/actions';
import NavigationService from '../../services/NavigationService';
+import {db} from '../../utils/utils';
const w = Dimensions.get('window').width;
const h = Dimensions.get('window').height;
@@ -69,10 +70,10 @@ export const Tags = ({navigation}) => {
fontSize: SIZE.xs,
color: colors.icon,
}}>
- {item && item.count && item.count > 1
- ? item.count + ' notes'
- : item.count === 1
- ? item.count + ' note'
+ {item && item.noteIds.length && item.noteIds.length > 1
+ ? item.noteIds.length + ' notes'
+ : item.noteIds.length === 1
+ ? item.noteIds.length + ' note'
: null}
</Text>
</Text>