mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 06:59:31 +01:00
some minor changes
This commit is contained in:
@@ -36,8 +36,10 @@ import {
|
|||||||
eClosePremiumDialog,
|
eClosePremiumDialog,
|
||||||
eDispatchAction,
|
eDispatchAction,
|
||||||
eOnLoadNote,
|
eOnLoadNote,
|
||||||
|
eOpenLoginDialog,
|
||||||
eOpenPendingDialog,
|
eOpenPendingDialog,
|
||||||
eOpenPremiumDialog,
|
eOpenPremiumDialog,
|
||||||
|
eOpenProgressDialog,
|
||||||
eOpenSideMenu,
|
eOpenSideMenu,
|
||||||
eShowGetPremium,
|
eShowGetPremium,
|
||||||
eStartSyncer,
|
eStartSyncer,
|
||||||
@@ -270,6 +272,18 @@ const App = () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const onLogout = (reason) => {
|
||||||
|
eSendEvent(eOpenProgressDialog, {
|
||||||
|
title: 'User Logged Out',
|
||||||
|
paragraph: reason,
|
||||||
|
action: () => {
|
||||||
|
eSendEvent(eOpenLoginDialog);
|
||||||
|
},
|
||||||
|
actionText: 'Login Again',
|
||||||
|
noProgress: true,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
eSubscribeEvent(eStartSyncer, startSyncer);
|
eSubscribeEvent(eStartSyncer, startSyncer);
|
||||||
eSubscribeEvent(eDispatchAction, (type) => {
|
eSubscribeEvent(eDispatchAction, (type) => {
|
||||||
@@ -284,9 +298,11 @@ const App = () => {
|
|||||||
let unsub = NetInfo.addEventListener(onNetworkStateChanged);
|
let unsub = NetInfo.addEventListener(onNetworkStateChanged);
|
||||||
Linking.addEventListener('url', _handleIntent);
|
Linking.addEventListener('url', _handleIntent);
|
||||||
EV.subscribe('db:sync', dbSync);
|
EV.subscribe('db:sync', dbSync);
|
||||||
|
EV.subscribe('user:loggedOut', onLogout);
|
||||||
EV.subscribe('user:checkStatus', handlePremiumAccess);
|
EV.subscribe('user:checkStatus', handlePremiumAccess);
|
||||||
return () => {
|
return () => {
|
||||||
EV.unsubscribe('db:refresh', syncChanges);
|
EV.unsubscribe('db:refresh', syncChanges);
|
||||||
|
EV.unsubscribe('user:loggedOut', onLogout);
|
||||||
EV.unsubscribe('db:sync', dbSync);
|
EV.unsubscribe('db:sync', dbSync);
|
||||||
eUnSubscribeEvent(eStartSyncer, startSyncer);
|
eUnSubscribeEvent(eStartSyncer, startSyncer);
|
||||||
eUnSubscribeEvent(eDispatchAction, (type) => {
|
eUnSubscribeEvent(eDispatchAction, (type) => {
|
||||||
@@ -321,7 +337,7 @@ const App = () => {
|
|||||||
db.notes.init().then(() => {
|
db.notes.init().then(() => {
|
||||||
dispatch({type: Actions.NOTES});
|
dispatch({type: Actions.NOTES});
|
||||||
dispatch({type: Actions.FAVORITES});
|
dispatch({type: Actions.FAVORITES});
|
||||||
eSendEvent(refreshNotesPage)
|
eSendEvent(refreshNotesPage);
|
||||||
dispatch({type: Actions.LOADING, loading: false});
|
dispatch({type: Actions.LOADING, loading: false});
|
||||||
SettingsService.setAppLoaded();
|
SettingsService.setAppLoaded();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -60,7 +60,6 @@ export const NoteItemWrapper = ({item, index, isTrash = false}) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onPress = async () => {
|
const onPress = async () => {
|
||||||
|
|
||||||
if (note.conflicted) {
|
if (note.conflicted) {
|
||||||
eSendEvent(eShowMergeDialog, note);
|
eSendEvent(eShowMergeDialog, note);
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -91,6 +91,8 @@ const SimpleList = ({
|
|||||||
justifyContent: 'space-between',
|
justifyContent: 'space-between',
|
||||||
paddingHorizontal: 12,
|
paddingHorizontal: 12,
|
||||||
height: 35,
|
height: 35,
|
||||||
|
backgroundColor: index === 1 ? colors.shade : colors.nav,
|
||||||
|
marginTop: index === 1 ? 0 : 5,
|
||||||
}}>
|
}}>
|
||||||
<TouchableWithoutFeedback
|
<TouchableWithoutFeedback
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
@@ -103,15 +105,16 @@ const SimpleList = ({
|
|||||||
height: '100%',
|
height: '100%',
|
||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
}}>
|
}}>
|
||||||
<Paragraph
|
<Heading
|
||||||
color={colors.accent}
|
color={colors.accent}
|
||||||
|
size={SIZE.sm}
|
||||||
style={{
|
style={{
|
||||||
minWidth: 60,
|
minWidth: 60,
|
||||||
alignSelf: 'center',
|
alignSelf: 'center',
|
||||||
textAlignVertical: 'center',
|
textAlignVertical: 'center',
|
||||||
}}>
|
}}>
|
||||||
{item.title}
|
{item.title}
|
||||||
</Paragraph>
|
</Heading>
|
||||||
</TouchableWithoutFeedback>
|
</TouchableWithoutFeedback>
|
||||||
{index === 1 && sortMenuButton ? <HeaderMenu /> : null}
|
{index === 1 && sortMenuButton ? <HeaderMenu /> : null}
|
||||||
</View>
|
</View>
|
||||||
@@ -234,12 +237,12 @@ const SimpleList = ({
|
|||||||
break;
|
break;
|
||||||
case 'header':
|
case 'header':
|
||||||
dim.width = width;
|
dim.width = width;
|
||||||
dim.height = 35 * fontScale;
|
dim.height = 40 * fontScale;
|
||||||
break;
|
break;
|
||||||
case 'MAIN_HEADER':
|
case 'MAIN_HEADER':
|
||||||
dim.width = width;
|
dim.width = width;
|
||||||
dim.height =
|
dim.height =
|
||||||
dataType === 'search' ? 0 : DDS.isLargeTablet() ? 50 : 200;
|
dataType === 'search' ? 0 : DDS.isLargeTablet() ? 50 : 195;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
dim.width = width;
|
dim.width = width;
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ export function setLoginMessage(dispatch) {
|
|||||||
},
|
},
|
||||||
data: {},
|
data: {},
|
||||||
icon: 'account-outline',
|
icon: 'account-outline',
|
||||||
type:"normal"
|
type: 'normal',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -38,15 +38,15 @@ export function setEmailVerifyMessage(dispatch) {
|
|||||||
action: () => {
|
action: () => {
|
||||||
eSendEvent(eCloseProgressDialog);
|
eSendEvent(eCloseProgressDialog);
|
||||||
},
|
},
|
||||||
|
actionText: 'Resend Confirmation Link',
|
||||||
noProgress: true,
|
noProgress: true,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
data: {},
|
data: {},
|
||||||
icon: 'alert',
|
icon: 'alert',
|
||||||
type:"error"
|
type: 'error',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function clearMessage(dispatch) {
|
export function clearMessage(dispatch) {
|
||||||
|
|||||||
Reference in New Issue
Block a user