-
Notifications
You must be signed in to change notification settings - Fork 99
/
Copy pathguest.ts
58 lines (45 loc) · 1.3 KB
/
guest.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/**
* Nextcloud Cookbook app
* Vue frontend entry file
* ---------------------------
* @license AGPL3 or later
*/
/// <reference types="@nextcloud/typings" />
import Vue from 'vue';
import { useStore } from './store';
import AppInvalidGuest from './components/AppInvalidGuest.vue';
declare global {
interface Window {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
OC:
| Nextcloud.v16.OC
| Nextcloud.v17.OC
| Nextcloud.v18.OC
| Nextcloud.v19.OC
| Nextcloud.v20.OC;
n: string;
t: string;
}
}
const isDevServer = process.env.WEBPACK_DEV_SERVER;
// eslint-disable-next-line camelcase,no-undef
if (isDevServer || false) {
// eslint-disable-next-line camelcase,no-undef
__webpack_public_path__ = 'http://127.0.0.1:3000/apps/cookbook/js/';
}
// Fetch Nextcloud nonce identifier for dynamic script loading
// eslint-disable-next-line camelcase,no-undef
__webpack_nonce__ = btoa(window.OC.requestToken);
// Also make the injections available in Vue components
Vue.prototype.OC = window.OC;
// Pass translation engine to Vue
Vue.prototype.t = window.t;
Vue.prototype.n = window.n;
const store = useStore();
store.dispatch('refreshConfig');
// Start the app once document is done loading
const App = Vue.extend(AppInvalidGuest);
new App({
store,
// router,
}).$mount('#content');