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 "enabled": false
}, },
"_variables": { "_variables": {
"lastUpdateCheck": 1714413381505 "lastUpdateCheck": 1715513047752
} }
} }

@ -294,7 +294,10 @@ export function GenerateRoadmap(props: GenerateRoadmapProps) {
setIsLoading(false); setIsLoading(false);
pageProgressMessage.set(''); pageProgressMessage.set('');
return response.roadmapSlug; return {
roadmapId: response.roadmapId,
roadmapSlug: response.roadmapSlug,
};
}; };
const downloadGeneratedRoadmapContent = async () => { const downloadGeneratedRoadmapContent = async () => {
@ -686,9 +689,9 @@ export function GenerateRoadmap(props: GenerateRoadmapProps) {
<button <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" 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 () => { onClick={async () => {
const roadmapSlug = await saveAIRoadmap(); const response = await saveAIRoadmap();
if (roadmapSlug) { if (response?.roadmapSlug) {
window.location.href = `/r/${roadmapSlug}`; window.location.href = `/r/${response.roadmapSlug}`;
} }
}} }}
disabled={isLoading} disabled={isLoading}
@ -703,10 +706,10 @@ export function GenerateRoadmap(props: GenerateRoadmapProps) {
<button <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" 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 () => { onClick={async () => {
const roadmapId = await saveAIRoadmap(); const response = await saveAIRoadmap();
if (roadmapId) { if (response?.roadmapId) {
window.open( window.open(
`${import.meta.env.PUBLIC_EDITOR_APP_URL}/${roadmapId}`, `${import.meta.env.PUBLIC_EDITOR_APP_URL}/${response?.roadmapId}`,
'_blank', '_blank',
); );
} }

Loading…
Cancel
Save