Skip to content

Commit f7cfc02

Browse files
Merge branch 'main' into main
2 parents 155cab5 + a19bf3d commit f7cfc02

35 files changed

+1550
-771
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/app-frontend/src/App.vue

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,10 @@ function handleAuxClick(e) {
521521
width: 'calc(100% - var(--right-bar-width))',
522522
}"
523523
></div>
524+
<div v-if="criticalErrorMessage" class="m-6 mb-0 flex flex-col border-red bg-bg-red rounded-2xl border-2 border-solid p-4 gap-1 font-semibold text-contrast">
525+
<h1 class="m-0 text-lg font-extrabold">{{ criticalErrorMessage.header }}</h1>
526+
<div class="markdown-body text-primary" v-html="renderString(criticalErrorMessage.body ?? '')"></div>
527+
</div>
524528
<RouterView v-slot="{ Component }">
525529
<template v-if="Component">
526530
<Suspense @pending="loading.startLoading()" @resolve="loading.stopLoading()">
@@ -592,12 +596,6 @@ function handleAuxClick(e) {
592596
<PromotionWrapper />
593597
</template>
594598
</div>
595-
<div class="view">
596-
<div v-if="criticalErrorMessage" class="critical-error-banner" data-tauri-drag-region>
597-
<h1>{{ criticalErrorMessage.header }}</h1>
598-
<div class="markdown-body" v-html="renderString(criticalErrorMessage.body ?? '')"></div>
599-
</div>
600-
</div>
601599
</div>
602600
<URLConfirmModal ref="urlModal" />
603601
<Notifications ref="notificationsWrapper" sidebar />

apps/frontend/nuxt.config.ts

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ export default defineNuxtConfig({
126126
homePageSearch?: any[];
127127
homePageNotifs?: any[];
128128
products?: any[];
129+
errors?: number[];
129130
} = {};
130131

131132
try {
@@ -157,6 +158,14 @@ export default defineNuxtConfig({
157158
},
158159
};
159160

161+
const caughtErrorCodes = new Set<number>();
162+
163+
function handleFetchError(err: any, defaultValue: any) {
164+
console.error("Error generating state: ", err);
165+
caughtErrorCodes.add(err.status);
166+
return defaultValue;
167+
}
168+
160169
const [
161170
categories,
162171
loaders,
@@ -168,15 +177,25 @@ export default defineNuxtConfig({
168177
homePageNotifs,
169178
products,
170179
] = await Promise.all([
171-
$fetch(`${API_URL}tag/category`, headers),
172-
$fetch(`${API_URL}tag/loader`, headers),
173-
$fetch(`${API_URL}tag/game_version`, headers),
174-
$fetch(`${API_URL}tag/donation_platform`, headers),
175-
$fetch(`${API_URL}tag/report_type`, headers),
176-
$fetch(`${API_URL}projects_random?count=60`, headers),
177-
$fetch(`${API_URL}search?limit=3&query=leave&index=relevance`, headers),
178-
$fetch(`${API_URL}search?limit=3&query=&index=updated`, headers),
179-
$fetch(`${API_URL.replace("/v2/", "/_internal/")}billing/products`, headers),
180+
$fetch(`${API_URL}tag/category`, headers).catch((err) => handleFetchError(err, [])),
181+
$fetch(`${API_URL}tag/loader`, headers).catch((err) => handleFetchError(err, [])),
182+
$fetch(`${API_URL}tag/game_version`, headers).catch((err) => handleFetchError(err, [])),
183+
$fetch(`${API_URL}tag/donation_platform`, headers).catch((err) =>
184+
handleFetchError(err, []),
185+
),
186+
$fetch(`${API_URL}tag/report_type`, headers).catch((err) => handleFetchError(err, [])),
187+
$fetch(`${API_URL}projects_random?count=60`, headers).catch((err) =>
188+
handleFetchError(err, []),
189+
),
190+
$fetch(`${API_URL}search?limit=3&query=leave&index=relevance`, headers).catch((err) =>
191+
handleFetchError(err, {}),
192+
),
193+
$fetch(`${API_URL}search?limit=3&query=&index=updated`, headers).catch((err) =>
194+
handleFetchError(err, {}),
195+
),
196+
$fetch(`${API_URL.replace("/v2/", "/_internal/")}billing/products`, headers).catch((err) =>
197+
handleFetchError(err, []),
198+
),
180199
]);
181200

182201
state.categories = categories;
@@ -188,6 +207,7 @@ export default defineNuxtConfig({
188207
state.homePageSearch = homePageSearch;
189208
state.homePageNotifs = homePageNotifs;
190209
state.products = products;
210+
state.errors = [...caughtErrorCodes];
191211

192212
await fs.writeFile("./src/generated/state.json", JSON.stringify(state));
193213

apps/frontend/src/assets/styles/layout.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@
126126
max-width: 80rem;
127127
column-gap: 0.75rem;
128128
padding: 0 1.5rem;
129+
padding-bottom: 1.5rem;
129130

130131
grid-template:
131132
"header"

0 commit comments

Comments
 (0)