mirror of
https://github.com/mattermost/focalboard.git
synced 2025-04-01 21:04:25 +02:00
GH-4007 Fix for welcome screen flashing (#4042)
* fix for welcome screen flashing * fix lint
This commit is contained in:
parent
8ca5fbd37c
commit
6ea67987e6
@ -20,7 +20,13 @@ import {RootState} from './index'
|
|||||||
|
|
||||||
export const fetchMe = createAsyncThunk(
|
export const fetchMe = createAsyncThunk(
|
||||||
'users/fetchMe',
|
'users/fetchMe',
|
||||||
async () => client.getMe(),
|
async () => {
|
||||||
|
const [me, myConfig] = await Promise.all([
|
||||||
|
client.getMe(),
|
||||||
|
client.getMyConfig(),
|
||||||
|
])
|
||||||
|
return {me, myConfig}
|
||||||
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
export const versionProperty = 'version72MessageCanceled'
|
export const versionProperty = 'version72MessageCanceled'
|
||||||
@ -84,12 +90,16 @@ const usersSlice = createSlice({
|
|||||||
},
|
},
|
||||||
extraReducers: (builder) => {
|
extraReducers: (builder) => {
|
||||||
builder.addCase(fetchMe.fulfilled, (state, action) => {
|
builder.addCase(fetchMe.fulfilled, (state, action) => {
|
||||||
state.me = action.payload || null
|
state.me = action.payload.me || null
|
||||||
state.loggedIn = Boolean(state.me)
|
state.loggedIn = Boolean(state.me)
|
||||||
|
if (action.payload.myConfig) {
|
||||||
|
state.myConfig = parseUserProps(action.payload.myConfig)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
builder.addCase(fetchMe.rejected, (state) => {
|
builder.addCase(fetchMe.rejected, (state) => {
|
||||||
state.me = null
|
state.me = null
|
||||||
state.loggedIn = false
|
state.loggedIn = false
|
||||||
|
state.myConfig = {}
|
||||||
})
|
})
|
||||||
|
|
||||||
// TODO: change this when the initial load is complete
|
// TODO: change this when the initial load is complete
|
||||||
|
Loading…
x
Reference in New Issue
Block a user