We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 698ee5b commit 946fe7aCopy full SHA for 946fe7a
1 file changed
ui/src/stores/modules/application.ts
@@ -1,9 +1,18 @@
1
import { defineStore } from 'pinia'
2
const useApplicationStore = defineStore('application', {
3
state: () => ({
4
- location: `${window.location.origin}${window.MaxKB.chatPrefix ? window.MaxKB.chatPrefix : window.MaxKB.prefix}/`,
+ location: `${getChatOrigin()}${
5
+ window.MaxKB.chatPrefix ? window.MaxKB.chatPrefix : window.MaxKB.prefix
6
+ }/`,
7
}),
8
actions: {},
9
})
10
11
+function getChatOrigin() {
12
+ if (import.meta.env.DEV && window.location.port === '3000') {
13
+ return `${window.location.protocol}//${window.location.hostname}:3001`
14
+ }
15
+ return window.location.origin
16
+}
17
+
18
export default useApplicationStore
0 commit comments