mirror of
https://github.com/mattermost/focalboard.git
synced 2025-03-26 20:53:55 +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(
|
||||
'users/fetchMe',
|
||||
async () => client.getMe(),
|
||||
async () => {
|
||||
const [me, myConfig] = await Promise.all([
|
||||
client.getMe(),
|
||||
client.getMyConfig(),
|
||||
])
|
||||
return {me, myConfig}
|
||||
},
|
||||
)
|
||||
|
||||
export const versionProperty = 'version72MessageCanceled'
|
||||
@ -84,12 +90,16 @@ const usersSlice = createSlice({
|
||||
},
|
||||
extraReducers: (builder) => {
|
||||
builder.addCase(fetchMe.fulfilled, (state, action) => {
|
||||
state.me = action.payload || null
|
||||
state.me = action.payload.me || null
|
||||
state.loggedIn = Boolean(state.me)
|
||||
if (action.payload.myConfig) {
|
||||
state.myConfig = parseUserProps(action.payload.myConfig)
|
||||
}
|
||||
})
|
||||
builder.addCase(fetchMe.rejected, (state) => {
|
||||
state.me = null
|
||||
state.loggedIn = false
|
||||
state.myConfig = {}
|
||||
})
|
||||
|
||||
// TODO: change this when the initial load is complete
|
||||
|
Loading…
x
Reference in New Issue
Block a user