fixed missing user_id & fix fadeclock

This commit is contained in:
srgooglo 2020-10-29 15:39:31 +01:00
parent fe6dd9258b
commit 9a123ae190
3 changed files with 18 additions and 4 deletions

View File

@ -13,7 +13,7 @@ import cookie from 'cookie_js'
export default {
namespace: 'app',
state: {
fadeclock: 1000,
fadeclock: 500,
splash: {
render: true,
fadeout: false
@ -109,9 +109,21 @@ export default {
window.location = callback
})
state.dispatcher({ type: "updateState", payload: { queryDone: true, splash: { render: true, fadeout: state.fadeclock } } })
if (state.session_valid) {
if (state.session_authframe && state.session_data) {
state.dispatcher({ type: "closeSplash" })
} else {
setTimeout(() => location.reload(), 5000)
}
} else {
state.dispatcher({ type: "closeSplash" })
}
},
*closeSplash({ }, { select }) {
const state = yield select(state => state.app)
state.dispatcher({ type: "updateState", payload: { queryDone: true, splash: { render: true, fadeout: state.fadeclock } } })
setTimeout(() => {
state.dispatcher({ type: "updateState", payload: { splash: { render: false, fadeout: false } } })
state.dispatcher({ type: "updateState", payload: { splash: { render: false, fadeout: false } } })
}, state.fadeclock)
},
*initHeaderSocket({ callback }, { call, put, select }) {
@ -245,6 +257,7 @@ export default {
from: "data"
},
callback: (callbackResponse) => {
verbosity([callbackResponse])
if (callbackResponse.code == 115) {
verbosity(`Cannot update userdata due an data is missing`)
return false

View File

@ -30,6 +30,7 @@ export default {
query: {
payload: {
from: payload.from,
user_id: payload.user_id ?? state.app.session_uuid,
username: payload.username ?? state.app.session_authframe["username"],
userToken: state.app.session_token
},

View File

@ -90,7 +90,7 @@ export default class UserIndexer extends React.Component {
promiseState = async state => new Promise(resolve => this.setState(state, resolve));
componentDidMount(){
if (matchRegexp) {
if (matchRegexp && this.props.app.session_valid) {
this.props.dispatch({
type: "user/get",
payload: {