fix: edit in editor button (#5652)

pull/5675/head
Arik Chakma 6 months ago committed by GitHub
parent 97e0059475
commit de89e56a47
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      .astro/settings.json
  2. 17
      src/components/GenerateRoadmap/GenerateRoadmap.tsx

@ -3,6 +3,6 @@
"enabled": false
},
"_variables": {
"lastUpdateCheck": 1714413381505
"lastUpdateCheck": 1715513047752
}
}

@ -294,7 +294,10 @@ export function GenerateRoadmap(props: GenerateRoadmapProps) {
setIsLoading(false);
pageProgressMessage.set('');
return response.roadmapSlug;
return {
roadmapId: response.roadmapId,
roadmapSlug: response.roadmapSlug,
};
};
const downloadGeneratedRoadmapContent = async () => {
@ -686,9 +689,9 @@ export function GenerateRoadmap(props: GenerateRoadmapProps) {
<button
className="inline-flex items-center justify-center gap-2 rounded-md bg-gray-200 py-1.5 pl-2.5 pr-3 text-xs font-medium text-black transition-colors duration-300 hover:bg-gray-300 sm:text-sm"
onClick={async () => {
const roadmapSlug = await saveAIRoadmap();
if (roadmapSlug) {
window.location.href = `/r/${roadmapSlug}`;
const response = await saveAIRoadmap();
if (response?.roadmapSlug) {
window.location.href = `/r/${response.roadmapSlug}`;
}
}}
disabled={isLoading}
@ -703,10 +706,10 @@ export function GenerateRoadmap(props: GenerateRoadmapProps) {
<button
className="hidden items-center justify-center gap-2 rounded-md bg-gray-200 py-1.5 pl-2.5 pr-3 text-xs font-medium text-black transition-colors duration-300 hover:bg-gray-300 sm:inline-flex sm:text-sm"
onClick={async () => {
const roadmapId = await saveAIRoadmap();
if (roadmapId) {
const response = await saveAIRoadmap();
if (response?.roadmapId) {
window.open(
`${import.meta.env.PUBLIC_EDITOR_APP_URL}/${roadmapId}`,
`${import.meta.env.PUBLIC_EDITOR_APP_URL}/${response?.roadmapId}`,
'_blank',
);
}

Loading…
Cancel
Save