mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-24 07:29:30 +01:00
fix: notes not change
This commit is contained in:
@@ -27,7 +27,7 @@ import {
|
||||
import {useTracked} from '../../provider';
|
||||
import {ACTIONS} from '../../provider/actions';
|
||||
import {eSendEvent} from '../../services/eventManager';
|
||||
import {eClearSearch, eOpenModalMenu} from '../../services/events';
|
||||
import {eClearSearch, eOpenModalMenu, refreshNotesPage} from '../../services/events';
|
||||
import NavigationService from '../../services/NavigationService';
|
||||
import {db, DDS, hexToRGBA, timeSince, ToastEvent} from '../../utils/utils';
|
||||
import {sideMenuOverlayRef} from '../../utils/refs';
|
||||
@@ -320,6 +320,7 @@ export const Menu = ({
|
||||
tag: item,
|
||||
type: 'tag',
|
||||
});
|
||||
|
||||
}}
|
||||
style={{
|
||||
flexDirection: 'row',
|
||||
@@ -383,11 +384,13 @@ export const Menu = ({
|
||||
key={item.id}
|
||||
activeOpacity={opacity / 2}
|
||||
onPress={() => {
|
||||
NavigationService.navigate('Notes', {
|
||||
let params = {
|
||||
type: 'color',
|
||||
title: item.title,
|
||||
color: item,
|
||||
});
|
||||
}
|
||||
NavigationService.navigate('Notes', params);
|
||||
eSendEvent(refreshNotesPage, params);
|
||||
close();
|
||||
}}
|
||||
style={{
|
||||
@@ -496,7 +499,6 @@ export const Menu = ({
|
||||
activeOpacity={opacity / 2}
|
||||
onPress={() => {
|
||||
item.close === false ? null : close();
|
||||
|
||||
item.func();
|
||||
}}
|
||||
style={{
|
||||
|
||||
@@ -37,6 +37,7 @@ export const Notes = ({navigation}) => {
|
||||
};
|
||||
}
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
if (isFocused) {
|
||||
init();
|
||||
@@ -45,6 +46,7 @@ export const Notes = ({navigation}) => {
|
||||
screen: params.type,
|
||||
});
|
||||
} else {
|
||||
setNotes([]);
|
||||
editing.actionAfterFirstSave = {
|
||||
type: null,
|
||||
};
|
||||
@@ -53,7 +55,6 @@ export const Notes = ({navigation}) => {
|
||||
|
||||
useEffect(() => {
|
||||
eSubscribeEvent(refreshNotesPage, init);
|
||||
|
||||
return () => {
|
||||
eUnSubscribeEvent(refreshNotesPage, init);
|
||||
editing.actionAfterFirstSave = {
|
||||
@@ -62,8 +63,11 @@ export const Notes = ({navigation}) => {
|
||||
};
|
||||
}, []);
|
||||
|
||||
const init = () => {
|
||||
console.log(params.color);
|
||||
const init = (data) => {
|
||||
params = navigation.state.params;
|
||||
if (data) {
|
||||
params = data;
|
||||
}
|
||||
eSendEvent(eScrollEvent, 0);
|
||||
if (params.type === 'tag') {
|
||||
let notesInTag = db.notes.tagged(params.tag.title);
|
||||
|
||||
Reference in New Issue
Block a user