debug
This commit is contained in:
parent
e5659fc5ad
commit
f51082c463
|
@ -20,8 +20,7 @@ function setupSession(app: Express) {
|
|||
maxAge: 1000 * 60 * 60 * 24 * 7 * 30 * 6,
|
||||
secure: inProd,
|
||||
domain: inProd ? "lingdocs.com" : undefined,
|
||||
// TODO: TRY TO SET TO TRUE
|
||||
httpOnly: false,
|
||||
httpOnly: true,
|
||||
},
|
||||
store: inProd
|
||||
? new RedisStore({ client: redis.createClient() })
|
||||
|
|
|
@ -264,6 +264,7 @@ class App extends Component<RouteComponentProps, State> {
|
|||
|
||||
private async handleLoadUser(): Promise<void> {
|
||||
try {
|
||||
console.log("loading user");
|
||||
const prevUser = this.state.user;
|
||||
const userOnServer = await getUser();
|
||||
if (userOnServer === "offline") return;
|
||||
|
@ -274,7 +275,9 @@ class App extends Component<RouteComponentProps, State> {
|
|||
return;
|
||||
}
|
||||
const { userTextOptionsRecord, serverOptionsAreNewer } = resolveTextOptions(userOnServer, prevUser, this.state.options.textOptionsRecord);
|
||||
const user: AT.LingdocsUser | undefined = {
|
||||
console.log("resolvedUserTextOptionsRecord", userTextOptionsRecord);
|
||||
console.log("serverRecordIsNewer", serverOptionsAreNewer);
|
||||
const user: AT.LingdocsUser = {
|
||||
...userOnServer,
|
||||
userTextOptionsRecord,
|
||||
};
|
||||
|
@ -289,6 +292,7 @@ class App extends Component<RouteComponentProps, State> {
|
|||
};
|
||||
this.handleOptionsUpdate({ type: "updateTextOptionsRecord", payload: textOptionsRecord });
|
||||
if (!serverOptionsAreNewer) {
|
||||
console.log("gonna save the new text options");
|
||||
updateUserTextOptionsRecord(userTextOptionsRecord);
|
||||
}
|
||||
if (user) {
|
||||
|
@ -394,7 +398,7 @@ class App extends Component<RouteComponentProps, State> {
|
|||
}
|
||||
}
|
||||
|
||||
private checkUserCronJob = new CronJob("* * * * *", () => {
|
||||
private checkUserCronJob = new CronJob("1/20 * * * * *", () => {
|
||||
this.handleLoadUser();
|
||||
})
|
||||
|
||||
|
|
Loading…
Reference in New Issue