File tree Expand file tree Collapse file tree 4 files changed +15
-11
lines changed
reader/_components/main-page/posts-list Expand file tree Collapse file tree 4 files changed +15
-11
lines changed Original file line number Diff line number Diff line change 4646 "discoverRoutes" : false ,
4747 "routesFile" : " routes.txt"
4848 },
49- "ssr" : true
49+ "ssr" : {
50+ "entry" : " server.ts"
51+ }
5052 },
5153 "configurations" : {
5254 "production" : {
6870 "optimization" : false ,
6971 "extractLicenses" : false ,
7072 "sourceMap" : true ,
71- "ssr" : false ,
72- "prerender" : false ,
7373 "fileReplacements" : [
7474 {
7575 "replace" : " src/environments/environment.ts" ,
Original file line number Diff line number Diff line change 11< div >
2- <!-- < router-outlet/>-- >
2+ < router-outlet />
33</ div >
Original file line number Diff line number Diff line change 99 ElementRef ,
1010 signal ,
1111 WritableSignal ,
12+ OnInit ,
1213} from '@angular/core' ;
1314import { RouterModule } from '@angular/router' ;
1415import { AboutMeComponent } from '../../../../shared/about-me/about-me.component' ;
@@ -32,7 +33,7 @@ import { TagsStore } from '../../../../shared/stores/tags.store';
3233 changeDetection : ChangeDetectionStrategy . OnPush ,
3334 schemas : [ CUSTOM_ELEMENTS_SCHEMA ] ,
3435} )
35- export class PostsListComponent {
36+ export class PostsListComponent implements OnInit {
3637 scroll = viewChild < ElementRef < HTMLElement > > ( 'scrollContainer' ) ;
3738 scrollProgress : WritableSignal < number > = signal ( 0 ) ;
3839 postStore = inject ( PostsStore ) ;
@@ -46,13 +47,16 @@ export class PostsListComponent {
4647 constructor ( ) {
4748 this . scrollProgress . set ( this . initialScroll ) ;
4849 afterNextRender ( ( ) => {
49- console . log ( 'Scroll:' , this . scroll ( ) ) ;
5050 this . scroll ( ) ?. nativeElement . addEventListener (
5151 'scroll' ,
5252 this . onScroll . bind ( this ) ,
5353 ) ;
5454 } ) ;
55- console . log ( 'init' ) ;
55+ }
56+
57+ //TODO: FIX HACK FOR PRERENDERING
58+ ngOnInit ( ) {
59+ setTimeout ( ( ) => { } , 0 ) ;
5660 }
5761
5862 onScroll ( event : Event ) {
Original file line number Diff line number Diff line change 1- import { Injectable } from '@angular/core' ;
1+ import { inject , Injectable , NgZone } from '@angular/core' ;
22import {
33 AuthChangeEvent ,
44 AuthSession ,
@@ -15,11 +15,11 @@ import { environment } from '../../environments/environment';
1515export class SupabaseService {
1616 private readonly supabase : SupabaseClient ;
1717 public session : AuthSession | null = null ;
18+ private readonly ngZone = inject ( NgZone ) ;
1819
1920 constructor ( ) {
20- this . supabase = createClient (
21- environment . supabaseUrl ,
22- environment . supabaseKey ,
21+ this . supabase = this . ngZone . runOutsideAngular ( ( ) =>
22+ createClient ( environment . supabaseUrl , environment . supabaseKey ) ,
2323 ) ;
2424 }
2525
You can’t perform that action at this time.
0 commit comments