@@ -96,6 +96,7 @@ export default function WidgetCard({
9696 const [ isLoading , setIsLoading ] = useState ( false )
9797 const [ isReturningUser , setIsReturningUser ] = useState ( false )
9898 const [ isWidget , setIsWidget ] = useState < boolean > ( false )
99+ const [ hasUploadedImage , setHasUploadedImage ] = useState < boolean > ( false )
99100
100101 const { app, setApp } = useAppStore ( ) // use for edit flow
101102 const searchParams = useSearchParams ( )
@@ -130,7 +131,7 @@ export default function WidgetCard({
130131 newQuestion = {
131132 id,
132133 type : "CATEGORY_QUESTION" ,
133- mainQuestion : "" ,
134+ mainQuestion : "Pick topics that interest you " ,
134135 supportingText : "" ,
135136 categories : [
136137 {
@@ -380,6 +381,7 @@ export default function WidgetCard({
380381
381382 const handleRemoveFile = ( mode ) => {
382383 setUploadedFile ( ( prev ) => ( { ...prev , [ mode ] : null } ) )
384+ setHasUploadedImage ( false )
383385 if ( fileInputRef . current ?. [ mode ] ) {
384386 fileInputRef . current [ mode ] . value = null
385387
@@ -454,7 +456,9 @@ export default function WidgetCard({
454456 const handleKeyDown = ( e ) => {
455457 if ( e . key === "Enter" ) {
456458 e . preventDefault ( )
457- addUrl ( )
459+ if ( urls . length < 3 ) {
460+ addUrl ( )
461+ }
458462 }
459463 }
460464
@@ -522,6 +526,9 @@ export default function WidgetCard({
522526 if ( questions . length > 0 && currentQuestionIndex >= questions . length ) {
523527 setCurrentQuestionIndex ( Math . max ( 0 , questions . length - 1 ) )
524528 }
529+ if ( customizationData ?. general ?. icon ?. light ) {
530+ setHasUploadedImage ( true )
531+ }
525532 } , [ questions . length , currentQuestionIndex ] )
526533
527534 const getCustomAppPlatforms = async ( appStreamId : string ) => {
@@ -550,6 +557,10 @@ export default function WidgetCard({
550557 setSelectedProfileType ( customProfile )
551558 setDisable ( false ) // Enable only "custom"
552559 }
560+
561+ if ( app . logos ?. dark || app . logos ?. light ) {
562+ setHasUploadedImage ( true )
563+ }
553564 }
554565 } , [ id , profileTypes , app ] )
555566
@@ -576,9 +587,9 @@ export default function WidgetCard({
576587 accept = "image/*"
577588 />
578589
579- { uploadedFile ?. light ? (
590+ { ( uploadedFile ?. light || hasUploadedImage ) ? (
580591 < div className = "flex items-center gap-2 bg-gray-100 px-3 py-1 rounded-md text-xs text-gray-700" >
581- < span className = "truncate max-w-[120px]" > { uploadedFile . light . name } </ span >
592+ < span className = "truncate max-w-[120px]" > { uploadedFile ? .light ? .name || "image" } </ span >
582593 < button onClick = { ( ) => handleRemoveFile ( "light" ) } >
583594 < X className = "w-4 h-4 text-red-500 hover:text-red-700" />
584595 </ button >
@@ -823,7 +834,13 @@ export default function WidgetCard({
823834 < div className = "space-y-5" >
824835 < div className = "flex items-center justify-between bg-gray-100 p-3 rounded-md" >
825836 < span className = "text-sm font-medium" > Enable custom onboarding flows</ span >
826- < Switch checked = { enableOnboarding } onCheckedChange = { setEnableOnboarding } />
837+ < Switch checked = { enableOnboarding } onCheckedChange = { ( ) => {
838+ setEnableOnboarding ( ( prev ) => ! prev )
839+ if ( enableOnboarding ) {
840+ setQuestions ( [ ] )
841+ setCurrentQuestionIndex ( 0 )
842+ }
843+ } } />
827844 </ div >
828845
829846 { enableOnboarding && (
@@ -998,12 +1015,12 @@ export default function WidgetCard({
9981015 </ div >
9991016 ) : (
10001017 < >
1001- < div className = "mb-5" >
1018+ { ! showRoulette && < div className = "mb-5" >
10021019 < PlatformConnection
10031020 setSelectedProfileType = { setSelectedProfileType }
10041021 selectedProfileType = { selectedProfileType }
10051022 />
1006- </ div >
1023+ </ div > }
10071024
10081025 < div className = "flex items-center justify-between bg-gray-100 p-3 rounded-md" >
10091026 < span className = "text-xs font-medium" >
@@ -1012,7 +1029,7 @@ export default function WidgetCard({
10121029 < Switch checked = { showRoulette } onCheckedChange = { setShowRoulette } />
10131030 </ div >
10141031
1015- { ! showRoulette && (
1032+ { showRoulette && (
10161033 < p className = "text-xs text-amber-600 mt-2" >
10171034 Platforms view disabled
10181035 </ p >
@@ -1100,6 +1117,7 @@ export default function WidgetCard({
11001117
11011118 if (
11021119 selectedProfileType ?. profileDetails ?. id == "custom" &&
1120+ ! showRoulette &&
11031121 ( ! profileName ||
11041122 profileName == "<profile_name>" ||
11051123 ! profileDescription ||
@@ -1123,6 +1141,7 @@ export default function WidgetCard({
11231141 enableOnboarding,
11241142 questions,
11251143 currentQuestionIndex,
1144+ showRoulette,
11261145 savedAt : new Date ( ) . getTime ( ) , // Add timestamp
11271146 }
11281147
@@ -1154,6 +1173,7 @@ export default function WidgetCard({
11541173 setAppName ( "<app_name_here>" )
11551174 setEnableOnboarding ( false )
11561175 setQuestions ( [ ] )
1176+ setShowRoulette ( false )
11571177 setCurrentQuestionIndex ( 0 )
11581178 setIsReturningUser ( false )
11591179 setIsWidget ( false )
0 commit comments