IO-1708 Add shop timezone & update server side calculations.

This commit is contained in:
Patrick Fic
2022-02-07 17:43:34 -08:00
parent 356928ce77
commit 91c5560fe8
29 changed files with 303 additions and 93 deletions

View File

@@ -41,6 +41,9 @@ import UserActionTypes from "./user.types";
import axios from "axios";
import { messaging } from "../../firebase/firebase.utils";
import { getToken } from "firebase/messaging";
import moment from "moment-timezone";
export function* onEmailSignInStart() {
yield takeLatest(UserActionTypes.EMAIL_SIGN_IN_START, signInWithEmail);
}
@@ -266,6 +269,12 @@ export function* onSetShopDetails() {
export function* SetAuthLevelFromShopDetails({ payload }) {
try {
const userEmail = yield select((state) => state.user.currentUser.email);
try {
console.log("Setting shop timezone.");
moment.tz.setDefault(payload.timezone);
} catch (error) {
console.log(error);
}
factory.client(payload.imexshopid);