1
0
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:
Scott Bishel 2022-10-20 03:00:12 -06:00 committed by GitHub
parent 8ca5fbd37c
commit 6ea67987e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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