fix: Refetch previews on start and switch to path-based routing
Two fixes: - Call previewsQuery.refetch() in startPreview.onSuccess so the UI transitions from "building" to the preview link without a page refresh. - Switch from subdomain routing (*.localhost) to path-based routing (localhost:<port>/<id>/) since macOS doesn't resolve wildcard localhost subdomains.
This commit is contained in:
@@ -73,6 +73,7 @@ export function InitiativeReview({ initiativeId, onCompleted }: InitiativeReview
|
||||
const startPreview = trpc.startPreview.useMutation({
|
||||
onSuccess: (data) => {
|
||||
setActivePreviewId(data.id);
|
||||
previewsQuery.refetch();
|
||||
toast.success(`Preview running at ${data.url}`);
|
||||
},
|
||||
onError: (err) => toast.error(`Preview failed: ${err.message}`),
|
||||
|
||||
@@ -99,6 +99,7 @@ export function ReviewTab({ initiativeId }: ReviewTabProps) {
|
||||
const startPreview = trpc.startPreview.useMutation({
|
||||
onSuccess: (data) => {
|
||||
setActivePreviewId(data.id);
|
||||
previewsQuery.refetch();
|
||||
toast.success(`Preview running at ${data.url}`);
|
||||
},
|
||||
onError: (err) => toast.error(`Preview failed: ${err.message}`),
|
||||
|
||||
Reference in New Issue
Block a user