Skip to content

Commit 5f04a3c

Browse files
committed
fix imports
1 parent e99806e commit 5f04a3c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

projects/localess-angular/browser/src/components/visual-editor.component.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import {Component, inject, OnInit} from "@angular/core";
1+
import {Component, inject, OnInit, PLATFORM_ID} from "@angular/core";
22
import {LOCALESS_BROWSER_CONFIG} from "../localess.config";
33
import {loadLocalessSync} from "@localess/js-client";
4+
import {isPlatformBrowser} from "@angular/common";
45

56
/**
67
* Visual Editor Script Enabler
@@ -14,8 +15,11 @@ import {loadLocalessSync} from "@localess/js-client";
1415
export abstract class VisualEditorComponent implements OnInit {
1516

1617
config = inject(LOCALESS_BROWSER_CONFIG)
18+
platformId = inject(PLATFORM_ID)
1719

1820
ngOnInit(): void {
19-
loadLocalessSync(this.config.origin)
21+
if (isPlatformBrowser(this.platformId)) {
22+
loadLocalessSync(this.config.origin)
23+
}
2024
}
2125
}

0 commit comments

Comments
 (0)