some minor changes

This commit is contained in:
ammarahm-ed
2020-12-16 20:02:24 +05:00
parent e69756dd65
commit d7a64bf957
4 changed files with 29 additions and 11 deletions

View File

@@ -36,8 +36,10 @@ import {
eClosePremiumDialog,
eDispatchAction,
eOnLoadNote,
eOpenLoginDialog,
eOpenPendingDialog,
eOpenPremiumDialog,
eOpenProgressDialog,
eOpenSideMenu,
eShowGetPremium,
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(() => {
eSubscribeEvent(eStartSyncer, startSyncer);
eSubscribeEvent(eDispatchAction, (type) => {
@@ -284,9 +298,11 @@ const App = () => {
let unsub = NetInfo.addEventListener(onNetworkStateChanged);
Linking.addEventListener('url', _handleIntent);
EV.subscribe('db:sync', dbSync);
EV.subscribe('user:loggedOut', onLogout);
EV.subscribe('user:checkStatus', handlePremiumAccess);
return () => {
EV.unsubscribe('db:refresh', syncChanges);
EV.unsubscribe('user:loggedOut', onLogout);
EV.unsubscribe('db:sync', dbSync);
eUnSubscribeEvent(eStartSyncer, startSyncer);
eUnSubscribeEvent(eDispatchAction, (type) => {
@@ -321,7 +337,7 @@ const App = () => {
db.notes.init().then(() => {
dispatch({type: Actions.NOTES});
dispatch({type: Actions.FAVORITES});
eSendEvent(refreshNotesPage)
eSendEvent(refreshNotesPage);
dispatch({type: Actions.LOADING, loading: false});
SettingsService.setAppLoaded();
});

View File

@@ -60,7 +60,6 @@ export const NoteItemWrapper = ({item, index, isTrash = false}) => {
};
const onPress = async () => {
if (note.conflicted) {
eSendEvent(eShowMergeDialog, note);
return;

View File

@@ -91,6 +91,8 @@ const SimpleList = ({
justifyContent: 'space-between',
paddingHorizontal: 12,
height: 35,
backgroundColor: index === 1 ? colors.shade : colors.nav,
marginTop: index === 1 ? 0 : 5,
}}>
<TouchableWithoutFeedback
onPress={() => {
@@ -103,15 +105,16 @@ const SimpleList = ({
height: '100%',
justifyContent: 'center',
}}>
<Paragraph
<Heading
color={colors.accent}
size={SIZE.sm}
style={{
minWidth: 60,
alignSelf: 'center',
textAlignVertical: 'center',
}}>
{item.title}
</Paragraph>
</Heading>
</TouchableWithoutFeedback>
{index === 1 && sortMenuButton ? <HeaderMenu /> : null}
</View>
@@ -234,12 +237,12 @@ const SimpleList = ({
break;
case 'header':
dim.width = width;
dim.height = 35 * fontScale;
dim.height = 40 * fontScale;
break;
case 'MAIN_HEADER':
dim.width = width;
dim.height =
dataType === 'search' ? 0 : DDS.isLargeTablet() ? 50 : 200;
dataType === 'search' ? 0 : DDS.isLargeTablet() ? 50 : 195;
break;
default:
dim.width = width;

View File

@@ -18,7 +18,7 @@ export function setLoginMessage(dispatch) {
},
data: {},
icon: 'account-outline',
type:"normal"
type: 'normal',
},
});
}
@@ -38,15 +38,15 @@ export function setEmailVerifyMessage(dispatch) {
action: () => {
eSendEvent(eCloseProgressDialog);
},
actionText: 'Resend Confirmation Link',
noProgress: true,
});
},
data: {},
icon: 'alert',
type:"error"
type: 'error',
},
});
}
export function clearMessage(dispatch) {