Skip to content

Commit eac722f

Browse files
committed
eu support
1 parent 5f7d359 commit eac722f

File tree

5 files changed

+19
-6
lines changed

5 files changed

+19
-6
lines changed

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,18 @@ npm run serve-pagination
6767
<fast-comments-vue v-bind:config="{tenantId: 'demo', url: 'https://example.com', urlId: 'some-page-id'}" />
6868
```
6969

70+
### Account Region (ATTENTION: EU Customers)
71+
72+
If your account is located in the EU, set `region = 'eu'` in the widget configuration, for example:
73+
74+
```vue
75+
<fast-comments-vue v-bind:config="{tenantId: 'demo', url: 'https://example.com', urlId: 'some-page-id', region: 'eu'}" />
76+
```
77+
78+
Otherwise, you do not have to define `region`.
7079

7180
## Contributing
72-
Please checkout our [contribution guidelines](CONTRIBUTING.md) before starting on a change. Remember to communicate first!
81+
Please check out our [contribution guidelines](CONTRIBUTING.md) before starting on a change. Remember to communicate first!
7382

7483
## License
7584

src/fastcomments-collab-chat.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@
4242
async mounted() {
4343
// @ts-ignore
4444
if (window && !window.FastCommentsCollabChat) {
45-
await insertScript('https://cdn.fastcomments.com/js/embed-collab-chat.min.js', 'fastcomments-collab-chat-script', window.document.body);
45+
const src = this.config.region === 'eu' ? 'https://cdn-eu.fastcomments.com/js/embed-collab-chat.min.js' : 'https://cdn.fastcomments.com/js/embed-collab-chat.min.js';
46+
await insertScript(src, 'fastcomments-collab-chat-script', window.document.body);
4647
}
4748
// @ts-ignore
4849
lastWidgetInstance = window.FastCommentsCollabChat(this.targetRef, this.config);

src/fastcomments-image-chat.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@
4242
async mounted() {
4343
// @ts-ignore
4444
if (window && !window.FastCommentsImageChat) {
45-
await insertScript('https://cdn.fastcomments.com/js/embed-image-chat.min.js', 'fastcomments-image-chat-script', window.document.body);
45+
const src = this.config.region === 'eu' ? 'https://cdn-eu.fastcomments.com/js/embed-image-chat.min.js' : 'https://cdn.fastcomments.com/js/embed-image-chat.min.js';
46+
await insertScript(src, 'fastcomments-image-chat-script', window.document.body);
4647
}
4748
// @ts-ignore
4849
lastWidgetInstance = window.FastCommentsImageChat(this.targetRef, this.config);

src/fastcomments-live-chat.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@
3939
async mounted() {
4040
// @ts-ignore
4141
if (window && !window.FastCommentsLiveChat) {
42-
await insertScript('https://cdn.fastcomments.com/js/embed-live-chat.min.js', 'fastcomments-live-chat-script', window.document.body);
42+
const src = this.config.region === 'eu' ? 'https://cdn-eu.fastcomments.com/js/embed-live-chat.min.js' : 'https://cdn.fastcomments.com/js/embed-live-chat.min.js';
43+
await insertScript(src, 'fastcomments-live-chat-script', window.document.body);
4344
}
4445
// @ts-ignore
4546
lastWidgetInstance = window.FastCommentsLiveChat(document.getElementById(this.widgetId), this.config);

src/fastcomments-vue.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script lang="ts">
22
import Vue from 'vue';
3-
import {FastCommentsCommentWidgetConfig} from "../../fastcomments-typescript/src";
3+
import {FastCommentsCommentWidgetConfig} from "fastcomments-typescript";
44
55
async function insertScript(src: string, id: string, parentElement: Element) {
66
return new Promise((resolve, reject) => {
@@ -39,7 +39,8 @@
3939
async mounted() {
4040
// @ts-ignore
4141
if (window && !window.FastCommentsUI) {
42-
await insertScript('https://cdn.fastcomments.com/js/embed-v2.min.js', 'fastcomments-widget-script', window.document.body);
42+
const src = this.config.region === 'eu' ? 'https://cdn-eu.fastcomments.com/js/embed-v2.min.js' : 'https://cdn.fastcomments.com/js/embed-v2.min.js';
43+
await insertScript(src, 'fastcomments-widget-script', window.document.body);
4344
}
4445
// @ts-ignore
4546
lastWidgetInstance = window.FastCommentsUI(document.getElementById(this.widgetId), this.config);

0 commit comments

Comments
 (0)