forked from 1b-agent/opencadstudio-upstream
feat(web): show Patreon supporters on the web build too
The browser can't call the Patreon API directly (CORS, and the token would be exposed in the bundle), so the web build fetches a pre-generated supporters.json served on the same origin. The Pages workflow generates it server-side with the token (CI secret) after the trunk build. Native keeps its live API fetch. serde_json moves to the shared dependencies so the wasm build can parse the list. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
572e9aca01
commit
0e74a11724
4 files changed
+72
-3
No files matched your search
+7
-1
@@ -2329,7 +2329,13 @@ impl OpenCADStudio {
|
||||
#[cfg_attr(target_arch = "wasm32", allow(unused_mut))]
|
||||
let mut s = Self::new();
|
||||
let focus = s.focus_cmd_input();
|
||||
(s, focus)
|
||||
// Web can't reach the Patreon API directly (CORS); fetch the CI-built
|
||||
// supporters.json served on the same origin instead.
|
||||
let patrons = Task::perform(
|
||||
crate::patreon::fetch_patrons_web(),
|
||||
Message::PatronsFetched,
|
||||
);
|
||||
(s, Task::batch([focus, patrons]))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user