Skip to content

Commit a7c774e

Browse files
FrancescoMolinaroSimone-Ramundi
authored andcommitted
[CST-14843] fix issue with social component
1 parent 1b19d0f commit a7c774e

4 files changed

Lines changed: 16 additions & 6 deletions

File tree

src/app/app.component.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
<ds-themed-root
22
[shouldShowFullscreenLoader]="(isAuthBlocking$ | async) || (isThemeLoading$ | async)"
33
[shouldShowRouteLoader]="isRouteLoading$ | async"></ds-themed-root>
4+
5+
<ds-social *ngIf="browserPlatform"></ds-social>

src/app/app.component.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,12 @@ export class AppComponent implements OnInit, AfterViewInit {
6161
*/
6262
idleModalOpen: boolean;
6363

64+
65+
/**
66+
* In order to show sharing component only in csr
67+
*/
68+
browserPlatform = false;
69+
6470
constructor(
6571
@Inject(NativeWindowService) private _window: NativeWindowRef,
6672
@Inject(DOCUMENT) private document: any,
@@ -78,11 +84,12 @@ export class AppComponent implements OnInit, AfterViewInit {
7884
private datadogRumService: DatadogRumService
7985
) {
8086
this.notificationOptions = environment.notifications;
87+
this.browserPlatform = isPlatformBrowser(this.platformId);
8188

8289
/* Use models object so all decorators are actually called */
8390
this.models = models;
8491

85-
if (isPlatformBrowser(this.platformId)) {
92+
if (this.browserPlatform) {
8693
this.trackIdleModal();
8794
}
8895

src/app/app.module.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import { StoreDevModules } from '../config/store/devtools';
3232
import { RootModule } from './root.module';
3333
import { NuMarkdownModule } from '@ng-util/markdown';
3434
import { FooterModule } from './footer/footer.module';
35+
import { SocialModule } from './social/social.module';
3536

3637
export function getConfig() {
3738
return environment;
@@ -120,10 +121,11 @@ const EXPORTS = [
120121
];
121122

122123
@NgModule({
123-
imports: [
124-
BrowserModule.withServerTransition({ appId: 'dspace-angular' }),
125-
...IMPORTS
126-
],
124+
imports: [
125+
BrowserModule.withServerTransition({appId: 'dspace-angular'}),
126+
...IMPORTS,
127+
SocialModule
128+
],
127129
providers: [
128130
...PROVIDERS
129131
],

src/app/root/root.component.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
</div>
2626
</div>
2727

28-
<ds-social *ngIf="browserPlatform"></ds-social>
2928

3029
<ds-notifications-board [options]="notificationOptions">
3130
</ds-notifications-board>

0 commit comments

Comments
 (0)