mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 15:09:33 +01:00
fixes
This commit is contained in:
@@ -26,7 +26,7 @@ import {useTracked} from '../../provider';
|
|||||||
import {ACTIONS} from '../../provider/actions';
|
import {ACTIONS} from '../../provider/actions';
|
||||||
import {moveNoteEvent} from '../DialogManager';
|
import {moveNoteEvent} from '../DialogManager';
|
||||||
import Share from 'react-native-share';
|
import Share from 'react-native-share';
|
||||||
import {timeConverter} from '../../utils/utils';
|
import {timeConverter, ToastEvent} from '../../utils/utils';
|
||||||
const w = Dimensions.get('window').width;
|
const w = Dimensions.get('window').width;
|
||||||
const h = Dimensions.get('window').height;
|
const h = Dimensions.get('window').height;
|
||||||
|
|
||||||
@@ -127,11 +127,32 @@ export const ActionSheetComponent = ({
|
|||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'note': {
|
case 'note': {
|
||||||
toAdd = db.notes.note(note.id).data;
|
toAdd = db.notes.note(note.id);
|
||||||
|
if (toAdd) {
|
||||||
|
toAdd = toAdd.data;
|
||||||
|
} else {
|
||||||
|
setTimeout(() => {
|
||||||
|
toAdd = db.notes.note(note.id);
|
||||||
|
if (toAdd) {
|
||||||
|
toAdd = toAdd.data;
|
||||||
|
}
|
||||||
|
}, 500);
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'notebook': {
|
case 'notebook': {
|
||||||
toAdd = db.notebooks.notebook(note.id).data;
|
toAdd = db.notebooks.notebook(note.id);
|
||||||
|
if (toAdd) {
|
||||||
|
toAdd = toAdd.data;
|
||||||
|
} else {
|
||||||
|
setTimeout(() => {
|
||||||
|
toAdd = db.notebooks.notebook(note.id);
|
||||||
|
if (toAdd) {
|
||||||
|
toAdd = toAdd.data;
|
||||||
|
}
|
||||||
|
}, 500);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'topic': {
|
case 'topic': {
|
||||||
@@ -213,9 +234,10 @@ export const ActionSheetComponent = ({
|
|||||||
{
|
{
|
||||||
name: 'Restore',
|
name: 'Restore',
|
||||||
icon: 'trash',
|
icon: 'trash',
|
||||||
func: () => {
|
func: async () => {
|
||||||
// TODO
|
await db.trash.restore(note.id);
|
||||||
//db.restoreItem(item.dateCreated);
|
dispatch({type: ACTIONS.TRASH});
|
||||||
|
localRefresh(note.type);
|
||||||
ToastEvent.show(
|
ToastEvent.show(
|
||||||
item.type === 'note' ? 'Note restored' : 'Notebook restored',
|
item.type === 'note' ? 'Note restored' : 'Notebook restored',
|
||||||
'success',
|
'success',
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
import React, {createRef, useState, useEffect} from 'react';
|
import React, {createRef, useEffect, useState} from 'react';
|
||||||
import {TextInput} from 'react-native';
|
import {TextInput} from 'react-native';
|
||||||
import * as Animatable from 'react-native-animatable';
|
import Animated, {Easing} from 'react-native-reanimated';
|
||||||
import Icon from 'react-native-vector-icons/Feather';
|
import Icon from 'react-native-vector-icons/Feather';
|
||||||
import {DDS} from '../../../App';
|
import {DDS} from '../../../App';
|
||||||
import {br, SIZE, WEIGHT} from '../../common/common';
|
import {br, SIZE, WEIGHT} from '../../common/common';
|
||||||
import {useTracked} from '../../provider';
|
import {useTracked} from '../../provider';
|
||||||
import Animated, {Easing} from 'react-native-reanimated';
|
|
||||||
|
|
||||||
const {Value, timing, block} = Animated;
|
const {Value, timing, block} = Animated;
|
||||||
|
|
||||||
|
|||||||
@@ -174,8 +174,17 @@ const Editor = ({navigation, noMenu}) => {
|
|||||||
|
|
||||||
if (id !== rId) {
|
if (id !== rId) {
|
||||||
id = rId;
|
id = rId;
|
||||||
|
|
||||||
note = db.notes.note(id);
|
note = db.notes.note(id);
|
||||||
|
if (note) {
|
||||||
|
note = note.data;
|
||||||
|
} else {
|
||||||
|
setTimeout(() => {
|
||||||
|
note = db.notes.note(id);
|
||||||
|
if (note) {
|
||||||
|
note = note.data;
|
||||||
|
}
|
||||||
|
}, 500);
|
||||||
|
}
|
||||||
|
|
||||||
if (DDS.isTab) {
|
if (DDS.isTab) {
|
||||||
dispatch({
|
dispatch({
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ export const Trash = ({navigation}) => {
|
|||||||
dispatch({
|
dispatch({
|
||||||
type: ACTIONS.TRASH,
|
type: ACTIONS.TRASH,
|
||||||
});
|
});
|
||||||
|
console.log(trash);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const _renderItem = ({item, index}) => (
|
const _renderItem = ({item, index}) => (
|
||||||
|
|||||||
Reference in New Issue
Block a user