mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 15:09:33 +01:00
make sure multiple default notes are not created
This commit is contained in:
@@ -51,7 +51,7 @@ const App = () => {
|
||||
await MMKV.setItem(
|
||||
'askForRating',
|
||||
JSON.stringify({
|
||||
timestamp: Date.now() + (86400000 * 2),
|
||||
timestamp: Date.now() + 86400000 * 2,
|
||||
}),
|
||||
);
|
||||
}
|
||||
@@ -104,6 +104,8 @@ const App = () => {
|
||||
|
||||
async function loadDefaultNotes() {
|
||||
try {
|
||||
const isCreated = await MMKV.getItem('defaultNoteCreated');
|
||||
if (isCreated) return;
|
||||
const notes = await http.get(
|
||||
'https://app.notesnook.com/notes/index.json',
|
||||
);
|
||||
@@ -117,6 +119,7 @@ const App = () => {
|
||||
content: {type: 'tiny', data: content},
|
||||
});
|
||||
}
|
||||
await MMKV.setItem('defaultNoteCreated', 'yes');
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
|
||||
@@ -245,7 +245,7 @@ const SplashScreen = () => {
|
||||
width={isNext ? null : '100%'}
|
||||
onPress={async () => {
|
||||
if (isNext) {
|
||||
carouselRef.current?.snapToNext();
|
||||
carouselRef.current?.snapToItem(currentIndex + 1,true,true);
|
||||
currentIndex++;
|
||||
if (currentIndex === 4) {
|
||||
setIsNext(false);
|
||||
|
||||
Reference in New Issue
Block a user