@@ -113,8 +113,10 @@ export class HyperboardController extends Controller {
113113 } ) ,
114114 ) ,
115115 backgroundImg : z
116- . string ( )
117- . url ( "Background image URL is not valid" )
116+ . union ( [
117+ z . string ( ) . url ( "Background image URL is not valid" ) ,
118+ z . literal ( "" ) ,
119+ ] )
118120 . optional ( ) ,
119121 borderColor : z
120122 . string ( )
@@ -437,8 +439,10 @@ export class HyperboardController extends Controller {
437439 } ) ,
438440 ) ,
439441 backgroundImg : z
440- . string ( )
441- . url ( "Background image URL is not valid" )
442+ . union ( [
443+ z . string ( ) . url ( "Background image URL is not valid" ) ,
444+ z . literal ( "" ) ,
445+ ] )
442446 . optional ( ) ,
443447 borderColor : z
444448 . string ( )
@@ -587,16 +591,8 @@ export class HyperboardController extends Controller {
587591 collection . id ,
588592 ) ;
589593 }
590- // Update metadata anyway because they are not collection specific
591- await dataService . upsertHyperboardHypercertMetadata (
592- collection . hypercerts . map ( ( hc ) => ( {
593- hypercert_id : hc . hypercertId ,
594- hyperboard_id : hyperboardId ,
595- collection_id : currentCollection . id ,
596- display_size : hc . factor ,
597- } ) ) ,
598- ) ;
599594
595+ // Update metadata anyway because they are not collection specific
600596 const currentUserIsAdminForCollection =
601597 currentCollection . collection_admins
602598 . flatMap ( ( x ) => x . admins )
@@ -622,6 +618,15 @@ export class HyperboardController extends Controller {
622618 collection_id : currentCollection . id ,
623619 } ) ) ,
624620 ) ;
621+
622+ await dataService . upsertHyperboardHypercertMetadata (
623+ collection . hypercerts . map ( ( hc ) => ( {
624+ hypercert_id : hc . hypercertId ,
625+ hyperboard_id : hyperboardId ,
626+ collection_id : currentCollection . id ,
627+ display_size : hc . factor ,
628+ } ) ) ,
629+ ) ;
625630 }
626631 } catch ( e ) {
627632 console . error ( e ) ;
0 commit comments