Skip to content

Commit 5448972

Browse files
committed
differentiate between loading and none
1 parent d4291d9 commit 5448972

1 file changed

Lines changed: 23 additions & 9 deletions

File tree

src/routes/panel/+page.svelte

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script>
22
import { onMount } from "svelte";
33
import { page } from "$app/stores";
4-
import { browser } from '$app/environment';
4+
import { browser } from "$app/environment";
55
import { PUBLIC_API_URL, PUBLIC_STUDIO_URL } from "$env/static/public";
66
import Authentication from "../../resources/authentication.js";
77
import LINK from "../../resources/urls.js";
@@ -32,7 +32,9 @@
3232
let loggedIn = null;
3333
let projectIdSelection;
3434
let serverStats = [];
35-
const selectForReject = browser ? $page.url.searchParams.get("reject") : null;
35+
const selectForReject = browser
36+
? $page.url.searchParams.get("reject")
37+
: null;
3638
3739
function kickOut(loggedOut) {
3840
const error = loggedOut ? 401 : 403;
@@ -158,6 +160,7 @@
158160
};
159161
160162
let projectListStyle = "";
163+
let reportsLoading = false;
161164
const refreshProjectMenu = () => {
162165
unapprovedProjects = [];
163166
contentWithReports = [];
@@ -201,8 +204,10 @@
201204
function openReportsMenu(type) {
202205
unapprovedProjects = [];
203206
contentWithReports = [];
207+
reportsLoading = true;
204208
ProjectClient.getTypeWithReports(type, 0).then(
205209
(projectsWithReports) => {
210+
reportsLoading = false;
206211
contentWithReports = projectsWithReports;
207212
console.log(contentWithReports);
208213
},
@@ -1847,8 +1852,8 @@
18471852
>
18481853
</div>
18491854
</div>
1850-
<br>
1851-
<br>
1855+
<br />
1856+
<br />
18521857
<input
18531858
type="text"
18541859
size="50"
@@ -1857,14 +1862,15 @@
18571862
placeholder="New username..."
18581863
bind:value={userSelectionData.newUsername}
18591864
/>
1860-
<br>
1865+
<br />
18611866
<label>
18621867
New Profile Picture:
18631868
<input type="file" on:change={setNewPfpInput} />
18641869
</label>
18651870
<br />
18661871
<br />
1867-
<Button color="purple" on:click={renameUser}>Rename User</Button>
1872+
<Button color="purple" on:click={renameUser}>Rename User</Button
1873+
>
18681874
<Button color="purple" on:click={changePfpUser}
18691875
>Change User's Profile Picture</Button
18701876
>
@@ -2141,10 +2147,18 @@
21412147
<p class="selection-info">
21422148
No removed projects currently!
21432149
</p>
2150+
{:else if dropdownSelectMenu.value === "project"}
2151+
{#if reportsLoading}
2152+
<p class="selection-info">
2153+
Project reports loading...
2154+
</p>
2155+
{:else}
2156+
<p class="selection-info">
2157+
No projects reports currently!
2158+
</p>
2159+
{/if}
21442160
{:else}
2145-
<p class="selection-info">
2146-
No project reports currently!
2147-
</p>
2161+
<p class="selection-info">how did you get here</p>
21482162
{/if}
21492163
{#each unapprovedProjects as project}
21502164
<div>

0 commit comments

Comments
 (0)