mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-02-24 04:00:59 +01:00
mobile: fix invalid tags linked to note from share menu
This commit is contained in:
@@ -84,16 +84,18 @@ async function createNotes(bundle) {
|
||||
|
||||
if (bundle.tags) {
|
||||
for (const tagId of bundle.tags) {
|
||||
await db.relations.add(
|
||||
{
|
||||
type: "tag",
|
||||
id: tagId
|
||||
},
|
||||
{
|
||||
id: id,
|
||||
type: "note"
|
||||
}
|
||||
);
|
||||
if (await db.tags.exists(tagId)) {
|
||||
await db.relations.add(
|
||||
{
|
||||
type: "tag",
|
||||
id: tagId
|
||||
},
|
||||
{
|
||||
id: id,
|
||||
type: "note"
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
const compress = bundle.compress;
|
||||
|
||||
@@ -27,7 +27,6 @@ import { defaultBorderRadius } from "../app/utils/size";
|
||||
export const AddTags = ({ onPress }) => {
|
||||
const { colors } = useThemeColors();
|
||||
const tagIds = useShareStore((state) => state.selectedTags);
|
||||
|
||||
return (
|
||||
<TouchableOpacity
|
||||
onPress={onPress}
|
||||
@@ -123,7 +122,7 @@ const TagItem = ({ tagId }) => {
|
||||
}}
|
||||
onPress={() => {
|
||||
const index = tagIds.indexOf(tagId);
|
||||
const selectedTags = [...tagId];
|
||||
const selectedTags = tagIds.slice();
|
||||
selectedTags.splice(index, 1);
|
||||
useShareStore.getState().setSelectedTags(selectedTags);
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user