Lint/format
This commit is contained in:
parent
4dcabd67a7
commit
449398b88f
2 changed files with 36 additions and 36 deletions
|
@ -32,7 +32,7 @@ const defaultState = {
|
|||
referrerSetError: '',
|
||||
};
|
||||
|
||||
reducers[ACTIONS.AUTHENTICATION_STARTED] = state =>
|
||||
reducers[ACTIONS.AUTHENTICATION_STARTED] = (state) =>
|
||||
Object.assign({}, state, {
|
||||
authenticationIsPending: true,
|
||||
userIsPending: true,
|
||||
|
@ -47,14 +47,14 @@ reducers[ACTIONS.AUTHENTICATION_SUCCESS] = (state, action) =>
|
|||
user: action.data.user,
|
||||
});
|
||||
|
||||
reducers[ACTIONS.AUTHENTICATION_FAILURE] = state =>
|
||||
reducers[ACTIONS.AUTHENTICATION_FAILURE] = (state) =>
|
||||
Object.assign({}, state, {
|
||||
authenticationIsPending: false,
|
||||
userIsPending: false,
|
||||
user: null,
|
||||
});
|
||||
|
||||
reducers[ACTIONS.USER_FETCH_STARTED] = state =>
|
||||
reducers[ACTIONS.USER_FETCH_STARTED] = (state) =>
|
||||
Object.assign({}, state, {
|
||||
userIsPending: true,
|
||||
});
|
||||
|
@ -66,7 +66,7 @@ reducers[ACTIONS.USER_FETCH_SUCCESS] = (state, action) =>
|
|||
emailToVerify: action.data.user.has_verified_email ? null : state.emailToVerify,
|
||||
});
|
||||
|
||||
reducers[ACTIONS.USER_FETCH_FAILURE] = state =>
|
||||
reducers[ACTIONS.USER_FETCH_FAILURE] = (state) =>
|
||||
Object.assign({}, state, {
|
||||
userIsPending: true,
|
||||
user: null,
|
||||
|
@ -88,7 +88,7 @@ reducers[ACTIONS.USER_PHONE_NEW_SUCCESS] = (state, action) =>
|
|||
phoneNewIsPending: false,
|
||||
});
|
||||
|
||||
reducers[ACTIONS.USER_PHONE_RESET] = state =>
|
||||
reducers[ACTIONS.USER_PHONE_RESET] = (state) =>
|
||||
Object.assign({}, state, {
|
||||
phoneToVerify: null,
|
||||
});
|
||||
|
@ -99,7 +99,7 @@ reducers[ACTIONS.USER_PHONE_NEW_FAILURE] = (state, action) =>
|
|||
phoneNewErrorMessage: action.data.error,
|
||||
});
|
||||
|
||||
reducers[ACTIONS.USER_PHONE_VERIFY_STARTED] = state =>
|
||||
reducers[ACTIONS.USER_PHONE_VERIFY_STARTED] = (state) =>
|
||||
Object.assign({}, state, {
|
||||
phoneVerifyIsPending: true,
|
||||
phoneVerifyErrorMessage: '',
|
||||
|
@ -118,7 +118,7 @@ reducers[ACTIONS.USER_PHONE_VERIFY_FAILURE] = (state, action) =>
|
|||
phoneVerifyErrorMessage: action.data.error,
|
||||
});
|
||||
|
||||
reducers[ACTIONS.USER_EMAIL_NEW_STARTED] = state =>
|
||||
reducers[ACTIONS.USER_EMAIL_NEW_STARTED] = (state) =>
|
||||
Object.assign({}, state, {
|
||||
emailNewIsPending: true,
|
||||
emailNewErrorMessage: '',
|
||||
|
@ -136,12 +136,12 @@ reducers[ACTIONS.USER_EMAIL_NEW_SUCCESS] = (state, action) => {
|
|||
});
|
||||
};
|
||||
|
||||
reducers[ACTIONS.USER_EMAIL_NEW_EXISTS] = state =>
|
||||
reducers[ACTIONS.USER_EMAIL_NEW_EXISTS] = (state) =>
|
||||
Object.assign({}, state, {
|
||||
emailAlreadyExists: true,
|
||||
});
|
||||
|
||||
reducers[ACTIONS.USER_EMAIL_NEW_DOES_NOT_EXIST] = state =>
|
||||
reducers[ACTIONS.USER_EMAIL_NEW_DOES_NOT_EXIST] = (state) =>
|
||||
Object.assign({}, state, {
|
||||
emailDoesNotExist: true,
|
||||
});
|
||||
|
@ -152,7 +152,7 @@ reducers[ACTIONS.USER_EMAIL_NEW_FAILURE] = (state, action) =>
|
|||
emailNewErrorMessage: action.data.error,
|
||||
});
|
||||
|
||||
reducers[ACTIONS.USER_EMAIL_NEW_CLEAR_ENTRY] = state => {
|
||||
reducers[ACTIONS.USER_EMAIL_NEW_CLEAR_ENTRY] = (state) => {
|
||||
const newUser = { ...state.user };
|
||||
delete newUser.primary_email;
|
||||
|
||||
|
@ -166,7 +166,7 @@ reducers[ACTIONS.USER_EMAIL_NEW_CLEAR_ENTRY] = state => {
|
|||
});
|
||||
};
|
||||
|
||||
reducers[ACTIONS.USER_PASSWORD_SET_CLEAR] = state =>
|
||||
reducers[ACTIONS.USER_PASSWORD_SET_CLEAR] = (state) =>
|
||||
Object.assign({}, state, {
|
||||
passwordResetSuccess: false,
|
||||
passwordResetPending: false,
|
||||
|
@ -175,7 +175,7 @@ reducers[ACTIONS.USER_PASSWORD_SET_CLEAR] = state =>
|
|||
passwordSetSuccess: false,
|
||||
});
|
||||
|
||||
reducers[ACTIONS.USER_EMAIL_VERIFY_STARTED] = state =>
|
||||
reducers[ACTIONS.USER_EMAIL_VERIFY_STARTED] = (state) =>
|
||||
Object.assign({}, state, {
|
||||
emailVerifyIsPending: true,
|
||||
emailVerifyErrorMessage: '',
|
||||
|
@ -202,7 +202,7 @@ reducers[ACTIONS.USER_EMAIL_VERIFY_SET] = (state, action) =>
|
|||
emailToVerify: action.data.email,
|
||||
});
|
||||
|
||||
reducers[ACTIONS.USER_IDENTITY_VERIFY_STARTED] = state =>
|
||||
reducers[ACTIONS.USER_IDENTITY_VERIFY_STARTED] = (state) =>
|
||||
Object.assign({}, state, {
|
||||
identityVerifyIsPending: true,
|
||||
identityVerifyErrorMessage: '',
|
||||
|
@ -229,7 +229,7 @@ reducers[ACTIONS.FETCH_ACCESS_TOKEN_SUCCESS] = (state, action) => {
|
|||
});
|
||||
};
|
||||
|
||||
reducers[ACTIONS.USER_INVITE_STATUS_FETCH_STARTED] = state =>
|
||||
reducers[ACTIONS.USER_INVITE_STATUS_FETCH_STARTED] = (state) =>
|
||||
Object.assign({}, state, {
|
||||
inviteStatusIsPending: true,
|
||||
});
|
||||
|
@ -243,13 +243,13 @@ reducers[ACTIONS.USER_INVITE_STATUS_FETCH_SUCCESS] = (state, action) =>
|
|||
referralCode: action.data.referralCode,
|
||||
});
|
||||
|
||||
reducers[ACTIONS.USER_INVITE_NEW_STARTED] = state =>
|
||||
reducers[ACTIONS.USER_INVITE_NEW_STARTED] = (state) =>
|
||||
Object.assign({}, state, {
|
||||
inviteNewIsPending: true,
|
||||
inviteNewErrorMessage: '',
|
||||
});
|
||||
|
||||
reducers[ACTIONS.USER_INVITE_NEW_SUCCESS] = state =>
|
||||
reducers[ACTIONS.USER_INVITE_NEW_SUCCESS] = (state) =>
|
||||
Object.assign({}, state, {
|
||||
inviteNewIsPending: false,
|
||||
inviteNewErrorMessage: '',
|
||||
|
@ -261,14 +261,14 @@ reducers[ACTIONS.USER_INVITE_NEW_FAILURE] = (state, action) =>
|
|||
inviteNewErrorMessage: action.data.error.message,
|
||||
});
|
||||
|
||||
reducers[ACTIONS.USER_INVITE_STATUS_FETCH_FAILURE] = state =>
|
||||
reducers[ACTIONS.USER_INVITE_STATUS_FETCH_FAILURE] = (state) =>
|
||||
Object.assign({}, state, {
|
||||
inviteStatusIsPending: false,
|
||||
invitesRemaining: null,
|
||||
invitees: null,
|
||||
});
|
||||
|
||||
reducers[ACTIONS.USER_YOUTUBE_IMPORT_STARTED] = state =>
|
||||
reducers[ACTIONS.USER_YOUTUBE_IMPORT_STARTED] = (state) =>
|
||||
Object.assign({}, state, {
|
||||
youtubeChannelImportPending: true,
|
||||
youtubeChannelImportErrorMessage: '',
|
||||
|
@ -293,28 +293,28 @@ reducers[ACTIONS.USER_YOUTUBE_IMPORT_FAILURE] = (state, action) =>
|
|||
youtubeChannelImportErrorMessage: action.data,
|
||||
});
|
||||
|
||||
reducers[ACTIONS.USER_EMAIL_VERIFY_RETRY_STARTED] = state =>
|
||||
reducers[ACTIONS.USER_EMAIL_VERIFY_RETRY_STARTED] = (state) =>
|
||||
Object.assign({}, state, {
|
||||
resendingVerificationEmail: true,
|
||||
});
|
||||
|
||||
reducers[ACTIONS.USER_EMAIL_VERIFY_RETRY_SUCCESS] = state =>
|
||||
reducers[ACTIONS.USER_EMAIL_VERIFY_RETRY_SUCCESS] = (state) =>
|
||||
Object.assign({}, state, {
|
||||
resendingVerificationEmail: false,
|
||||
});
|
||||
|
||||
reducers[ACTIONS.USER_EMAIL_VERIFY_RETRY_FAILURE] = state =>
|
||||
reducers[ACTIONS.USER_EMAIL_VERIFY_RETRY_FAILURE] = (state) =>
|
||||
Object.assign({}, state, {
|
||||
resendingVerificationEmail: false,
|
||||
});
|
||||
|
||||
reducers[ACTIONS.USER_SET_REFERRER_STARTED] = state =>
|
||||
reducers[ACTIONS.USER_SET_REFERRER_STARTED] = (state) =>
|
||||
Object.assign({}, state, {
|
||||
referrerSetIsPending: true,
|
||||
referrerSetError: defaultState.referrerSetError,
|
||||
});
|
||||
|
||||
reducers[ACTIONS.USER_SET_REFERRER_SUCCESS] = state =>
|
||||
reducers[ACTIONS.USER_SET_REFERRER_SUCCESS] = (state) =>
|
||||
Object.assign({}, state, {
|
||||
referrerSetIsPending: false,
|
||||
referrerSetError: defaultState.referrerSetError,
|
||||
|
@ -326,25 +326,25 @@ reducers[ACTIONS.USER_SET_REFERRER_FAILURE] = (state, action) =>
|
|||
referrerSetError: action.data.error.message,
|
||||
});
|
||||
|
||||
reducers[ACTIONS.USER_SET_REFERRER_RESET] = state =>
|
||||
reducers[ACTIONS.USER_SET_REFERRER_RESET] = (state) =>
|
||||
Object.assign({}, state, {
|
||||
referrerSetIsPending: false,
|
||||
referrerSetError: defaultState.referrerSetError,
|
||||
});
|
||||
|
||||
reducers[ACTIONS.USER_PASSWORD_EXISTS] = state =>
|
||||
reducers[ACTIONS.USER_PASSWORD_EXISTS] = (state) =>
|
||||
Object.assign({}, state, {
|
||||
passwordExistsForUser: true,
|
||||
});
|
||||
|
||||
reducers[ACTIONS.USER_PASSWORD_RESET_STARTED] = state =>
|
||||
reducers[ACTIONS.USER_PASSWORD_RESET_STARTED] = (state) =>
|
||||
Object.assign({}, state, {
|
||||
passwordResetPending: true,
|
||||
passwordResetSuccess: defaultState.passwordResetSuccess,
|
||||
passwordResetError: null,
|
||||
});
|
||||
|
||||
reducers[ACTIONS.USER_PASSWORD_RESET_SUCCESS] = state =>
|
||||
reducers[ACTIONS.USER_PASSWORD_RESET_SUCCESS] = (state) =>
|
||||
Object.assign({}, state, {
|
||||
passwordResetPending: false,
|
||||
passwordResetSuccess: true,
|
||||
|
@ -356,13 +356,13 @@ reducers[ACTIONS.USER_PASSWORD_RESET_FAILURE] = (state, action) =>
|
|||
passwordResetError: action.data.error,
|
||||
});
|
||||
|
||||
reducers[ACTIONS.USER_PASSWORD_SET_STARTED] = state =>
|
||||
reducers[ACTIONS.USER_PASSWORD_SET_STARTED] = (state) =>
|
||||
Object.assign({}, state, {
|
||||
passwordSetPending: true,
|
||||
passwordSetSuccess: defaultState.passwordSetSuccess,
|
||||
});
|
||||
|
||||
reducers[ACTIONS.USER_PASSWORD_SET_SUCCESS] = state =>
|
||||
reducers[ACTIONS.USER_PASSWORD_SET_SUCCESS] = (state) =>
|
||||
Object.assign({}, state, {
|
||||
passwordSetPending: false,
|
||||
passwordSetSuccess: true,
|
||||
|
|
|
@ -59,7 +59,7 @@ function deleteCookie(name) {
|
|||
}
|
||||
|
||||
function setSavedPassword(value, saveToDisk) {
|
||||
return new Promise(resolve => {
|
||||
return new Promise((resolve) => {
|
||||
const password = value === undefined || value === null ? '' : value;
|
||||
sessionPassword = password;
|
||||
|
||||
|
@ -74,17 +74,17 @@ function setSavedPassword(value, saveToDisk) {
|
|||
}
|
||||
|
||||
function getSavedPassword() {
|
||||
return new Promise(resolve => {
|
||||
return new Promise((resolve) => {
|
||||
if (sessionPassword) {
|
||||
resolve(sessionPassword);
|
||||
}
|
||||
|
||||
return getPasswordFromCookie().then(p => resolve(p));
|
||||
return getPasswordFromCookie().then((p) => resolve(p));
|
||||
});
|
||||
}
|
||||
|
||||
function getPasswordFromCookie() {
|
||||
return new Promise(resolve => {
|
||||
return new Promise((resolve) => {
|
||||
let password;
|
||||
password = getCookie(SAVED_PASSWORD);
|
||||
resolve(password);
|
||||
|
@ -92,7 +92,7 @@ function getPasswordFromCookie() {
|
|||
}
|
||||
|
||||
function deleteSavedPassword() {
|
||||
return new Promise(resolve => {
|
||||
return new Promise((resolve) => {
|
||||
deleteCookie(SAVED_PASSWORD);
|
||||
resolve();
|
||||
});
|
||||
|
@ -107,14 +107,14 @@ function setAuthToken(value) {
|
|||
}
|
||||
|
||||
function deleteAuthToken() {
|
||||
return new Promise(resolve => {
|
||||
return new Promise((resolve) => {
|
||||
deleteCookie(AUTH_TOKEN);
|
||||
resolve();
|
||||
});
|
||||
}
|
||||
|
||||
function doSignOutCleanup() {
|
||||
return new Promise(resolve => {
|
||||
return new Promise((resolve) => {
|
||||
deleteAuthToken();
|
||||
deleteSavedPassword();
|
||||
resolve();
|
||||
|
|
Loading…
Reference in a new issue