mirror of
https://github.com/hoornet/vega.git
synced 2026-06-08 06:01:57 -07:00
fix: harden updater null-handling, dev-mock install_info, honest interests copy
- useUpdater: guard the install_info response — a null/garbage value no longer overwrites the optimistic default and crash the whole app on installInfo.can_self_update. (Real app never returns null here; this is defensive — a failed updater check must not take down Vega.) - tauri-dev-mock: add an install_info case so browser dev mode (localhost:1420) doesn't crash on the post-onboarding render. - onboarding: the interests step claimed "you can always change this later" — there is no interests editor anywhere. Copy is now honest about what interests do (surface as hashtag pills on an empty Following feed).
This commit is contained in:
@@ -97,7 +97,7 @@ function InterestsStep({ onComplete }: { onComplete: () => void }) {
|
||||
return (
|
||||
<Shell step={2} totalSteps={3}>
|
||||
<Heading>What are you into?</Heading>
|
||||
<Body>Pick a few topics to get your feed started. You can always change this later.</Body>
|
||||
<Body>Pick a few topics — we'll suggest them as hashtags to explore.</Body>
|
||||
|
||||
<div className="grid grid-cols-3 gap-2 mb-7">
|
||||
{INTEREST_TOPICS.map(({ emoji, label, tag }) => {
|
||||
|
||||
@@ -32,7 +32,9 @@ export function useUpdater(): UpdateState {
|
||||
|
||||
useEffect(() => {
|
||||
invoke<InstallInfo>("install_info")
|
||||
.then(setInstallInfo)
|
||||
// Guard: a null/garbage response must not blow away the optimistic
|
||||
// default — installInfo is dereferenced unconditionally in the return.
|
||||
.then((info) => { if (info) setInstallInfo(info); })
|
||||
.catch(() => { /* keep optimistic default */ });
|
||||
}, []);
|
||||
|
||||
|
||||
@@ -29,6 +29,9 @@ if (import.meta.env.DEV && !(window as any).__TAURI_INTERNALS__) {
|
||||
return [];
|
||||
case "db_load_profile":
|
||||
return null;
|
||||
case "install_info":
|
||||
// Browser dev mode has no real install — mirror useUpdater's default.
|
||||
return { can_self_update: true, kind: "updater" };
|
||||
default:
|
||||
console.warn("[tauri-dev-mock] unhandled invoke:", cmd, args);
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user