Uh oh!
There was an error while loading. Please reload this page.
Update create function cover for case where VCS is not enabled - #544
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
ArmanNik
left a comment
There was a problem hiding this comment.
I don't think it makes sense to await the consoleVariables in the main layout.ts we can await them when we need them 👍
| isDomainsEnabled = (await $consoleVariables)?._APP_DOMAIN_ENABLED === true; | ||
| }); | ||
| const isDomainsEnabled = $consoleVariables?._APP_DOMAIN_ENABLED === true; |
There was a problem hiding this comment.
$consoleVariables might need to be awaited since we are not doing it in the layout
| onMount(async () => { | ||
| isAssistantEnabled = (await $consoleVariables)?._APP_ASSISTANT_ENABLED === true; | ||
| }); | ||
| const isAssistantEnabled = $consoleVariables?._APP_ASSISTANT_ENABLED === true; |
There was a problem hiding this comment.
This might need to be awaited too 🤔
| return { | ||
| consoleVariables: sdk.forConsole.console.variables(), | ||
| consoleVariables: await sdk.forConsole.console.variables(), |
There was a problem hiding this comment.
We didn't await it here to avoid a needless extra fetch request that might slow stuff down 😄
There was a problem hiding this comment.
I'm not sure if it's worth it because:
- it complicates the rest of the code
- the variables are fetched 20ms after version even before this change
What could be useful is fetching both the version and the variables concurrently.
| import { consoleVariables } from '$routes/console/store'; | ||
| const functionId = $page.params.function; | ||
| const isVcsEnabled = $consoleVariables?._APP_VCS_ENABLED === true; |
17ac61d to
93a7323Compareawait the data during load so it's available downstream without needing to await.
93a7323 to
d6def22CompareUh oh!
There was an error while loading. Please reload this page.
d6def22 to
a3bc3f8Compare
What does this PR do?
Closesappwrite/appwrite#6180
Test Plan
Manual w/o VCS:
Manual w/ VCS:
Related PRs and Issues
Have you read the Contributing Guidelines on issues?
Yes