mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-22 06:29:29 +01:00
minor bug fixes
This commit is contained in:
@@ -16,8 +16,7 @@ import {
|
|||||||
} from '../../assets/images/assets';
|
} from '../../assets/images/assets';
|
||||||
import {useTracked} from '../../provider';
|
import {useTracked} from '../../provider';
|
||||||
import FastImage from 'react-native-fast-image';
|
import FastImage from 'react-native-fast-image';
|
||||||
export const Placeholder = React.memo(
|
export const Placeholder = ({type, w, h, color}) => {
|
||||||
({type, w, h, color}) => {
|
|
||||||
const [state, dispatch] = useTracked();
|
const [state, dispatch] = useTracked();
|
||||||
const {colors} = state;
|
const {colors} = state;
|
||||||
const getSVG = () => {
|
const getSVG = () => {
|
||||||
@@ -53,10 +52,8 @@ export const Placeholder = React.memo(
|
|||||||
width={w}
|
width={w}
|
||||||
height={h}
|
height={h}
|
||||||
/>
|
/>
|
||||||
);
|
)
|
||||||
},
|
}
|
||||||
() => true,
|
|
||||||
);
|
|
||||||
|
|
||||||
export const SvgToPngView = ({width, height, src, color, img}) => {
|
export const SvgToPngView = ({width, height, src, color, img}) => {
|
||||||
const [error, setError] = useState(false);
|
const [error, setError] = useState(false);
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ import {openLinkInBrowser} from '../../utils/functions';
|
|||||||
import {Modal} from 'react-native';
|
import {Modal} from 'react-native';
|
||||||
import {SafeAreaView} from 'react-native';
|
import {SafeAreaView} from 'react-native';
|
||||||
import {SvgToPngView} from '../ListPlaceholders';
|
import {SvgToPngView} from '../ListPlaceholders';
|
||||||
|
import { MMKV } from '../../utils/mmkv';
|
||||||
|
|
||||||
const features = [
|
const features = [
|
||||||
{
|
{
|
||||||
@@ -81,7 +82,7 @@ const SplashScreen = () => {
|
|||||||
const translateY2 = useValue(0);
|
const translateY2 = useValue(0);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
Storage.read('introCompleted').then(async (r) => {
|
MMKV.getStringAsync('introCompleted').then(async (r) => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (!r) {
|
if (!r) {
|
||||||
setVisible(true);
|
setVisible(true);
|
||||||
|
|||||||
@@ -69,6 +69,7 @@ export const NavigationStack = ({component = NavigatorStack}) => {
|
|||||||
width: deviceMode !== 'mobile' ? 0 : '75%',
|
width: deviceMode !== 'mobile' ? 0 : '75%',
|
||||||
borderRightWidth: 0,
|
borderRightWidth: 0,
|
||||||
}}
|
}}
|
||||||
|
|
||||||
edgeWidth={200}
|
edgeWidth={200}
|
||||||
drawerType="slide"
|
drawerType="slide"
|
||||||
drawerContent={deviceMode !== 'mobile' ? () => <></> : DrawerComponent}
|
drawerContent={deviceMode !== 'mobile' ? () => <></> : DrawerComponent}
|
||||||
|
|||||||
@@ -407,24 +407,30 @@ function onNoteChange() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function clearEditor() {
|
export async function clearEditor() {
|
||||||
tiny.call(EditorWebView, tiny.reset, true);
|
try {
|
||||||
clearTimer();
|
tiny.call(EditorWebView, tiny.reset, true);
|
||||||
if (
|
clearTimer();
|
||||||
(content?.data && content.data?.trim().length > 0) ||
|
if (
|
||||||
(title && title.trim().length > 0)
|
(content?.data &&
|
||||||
) {
|
typeof content.data == 'string' &&
|
||||||
await saveNote(true);
|
content.data?.trim().length > 0) ||
|
||||||
|
(title && title?.trim().length > 0)
|
||||||
|
) {
|
||||||
|
await saveNote(true);
|
||||||
|
}
|
||||||
|
clearNote();
|
||||||
|
editing.focusType = null;
|
||||||
|
eSendEvent('historyEvent', {
|
||||||
|
undo: 0,
|
||||||
|
redo: 0,
|
||||||
|
});
|
||||||
|
saveCounter = 0;
|
||||||
|
setTimeout(() => {
|
||||||
|
updateEvent({type: Actions.CURRENT_EDITING_NOTE, id: null});
|
||||||
|
}, 1);
|
||||||
|
} catch (e) {
|
||||||
|
console.log(e);
|
||||||
}
|
}
|
||||||
clearNote();
|
|
||||||
editing.focusType = null;
|
|
||||||
eSendEvent('historyEvent', {
|
|
||||||
undo: 0,
|
|
||||||
redo: 0,
|
|
||||||
});
|
|
||||||
saveCounter = 0;
|
|
||||||
setTimeout(() => {
|
|
||||||
updateEvent({type: Actions.CURRENT_EDITING_NOTE, id: null});
|
|
||||||
}, 1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function setNoteInEditorAfterSaving(oldId, currentId) {
|
async function setNoteInEditorAfterSaving(oldId, currentId) {
|
||||||
|
|||||||
Reference in New Issue
Block a user