aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-08-24 15:40:01 +0300
committerGravatar Vitaly Takmazov2023-01-13 10:37:53 +0300
commit11ea9ad7a922ee80734a3a9c7f3ae8c94fe46522 (patch)
tree4848d5458b5dda26ebba9ac3589d6d83bf970a7a
parent39ea324923236fd7e77159bc3ce60d38a158426b (diff)
save uid to cookie to prevent initial reload
-rw-r--r--vnext/src/App.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/vnext/src/App.js b/vnext/src/App.js
index af12c3a7..730deb19 100644
--- a/vnext/src/App.js
+++ b/vnext/src/App.js
@@ -29,7 +29,7 @@ export default class App extends React.Component {
}
this.state = {
visitor: {
- uid: 0,
+ uid: cookies.load('_juick_uid') || 0,
hash: cookies.load('hash')
}
};
@@ -232,6 +232,7 @@ export default class App extends React.Component {
);
}
auth = (visitor) => {
+ cookies.save('_juick_uid', visitor.uid, { path: '/' });
this.setState({
visitor: visitor
});