Skip to content

Commit

Permalink
chore(editor): remove unneeded network call (#6399)
Browse files Browse the repository at this point in the history
**Problem:**
We have a `/permissions` network call on our loading critical path, but
its result is not being used (yet?)

**Fix:**
Remove the call for now since it is sometimes blocking loading the
editor (competing for network)

- [X] I opened a hydrogen project and it loaded
- [X] I could navigate to various routes in Preview mode
  • Loading branch information
liady authored Sep 26, 2024
1 parent cb8c0f2 commit 94a6c07
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions editor/src/templates/editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ import {
import {
getLoginState,
getUserConfiguration,
getUserPermissions,
startPollingLoginState,
} from '../components/editor/server'
import type { DispatchResult } from '../components/editor/store/dispatch'
Expand Down Expand Up @@ -347,10 +346,7 @@ export class Editor {
const projectId = getProjectID()
startPollingLoginState(this.boundDispatch, loginState)
this.storedState.userState.loginState = loginState
void Promise.all([
getUserConfiguration(loginState),
getUserPermissions(loginState, projectId),
]).then(([shortcutConfiguration, permissions]) => {
void getUserConfiguration(loginState).then((shortcutConfiguration) => {
const userState = {
...this.storedState.userState,
...shortcutConfiguration,
Expand Down

0 comments on commit 94a6c07

Please sign in to comment.