Skip to content
This repository was archived by the owner on Mar 16, 2025. It is now read-only.

Commit 1ab906e

Browse files
committed
add user suspense
1 parent 083cee7 commit 1ab906e

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

packages/app/src/components/Home/Home.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,13 @@ export function Home() {
8787
</Button>
8888
</form>
8989

90-
<Show when={user()}>
91-
<div class={choiceSeparator}>Your scratches & forks</div>
90+
<Suspense>
91+
<Show when={user()}>
92+
<div class={choiceSeparator}>Your scratches & forks</div>
9293

93-
<ScratchList />
94-
</Show>
94+
<ScratchList />
95+
</Show>
96+
</Suspense>
9597
</div>
9698

9799
<HomeFooter />

packages/app/src/lib/server/appwrite.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
import {action, redirect} from '@solidjs/router';
2-
import {Account, Client, Databases, OAuthProvider} from 'node-appwrite';
3-
import {getHeaders} from 'vinxi/http';
1+
import {Account, Client, Databases} from 'node-appwrite';
42
import {getSession} from './session';
53

64
export async function createSessionClient() {
7-
'use server';
85
const projectId = process.env.APPWRITE_CLOUD_PROJECT_ID!;
96
const endpoint = process.env.APPWRITE_CLOUD_URL!;
107
const client = new Client().setProject(projectId).setEndpoint(endpoint);
@@ -26,7 +23,6 @@ export async function createSessionClient() {
2623
}
2724

2825
export async function createAdminClient() {
29-
'use server';
3026
const apiKey = process.env.APPWRITE_CLOUD_FULL_ACCESS_API_KEY!;
3127
const projectId = process.env.APPWRITE_CLOUD_PROJECT_ID!;
3228
const endpoint = process.env.APPWRITE_CLOUD_URL!;

0 commit comments

Comments
 (0)