debian-mirror-gitlab/app/assets/javascripts/whats_new/index.js

37 lines
728 B
JavaScript
Raw Normal View History

2020-10-24 23:57:45 +05:30
import Vue from 'vue';
2021-02-22 17:27:13 +05:30
import { mapState } from 'vuex';
2020-10-24 23:57:45 +05:30
import App from './components/app.vue';
import store from './store';
2021-04-29 21:17:54 +05:30
import { getVersionDigest, setNotification } from './utils/notification';
2020-10-24 23:57:45 +05:30
2020-11-24 15:15:51 +05:30
let whatsNewApp;
2020-10-24 23:57:45 +05:30
2021-03-08 18:12:59 +05:30
export default (el) => {
2020-11-24 15:15:51 +05:30
if (whatsNewApp) {
store.dispatch('openDrawer');
} else {
whatsNewApp = new Vue({
2021-02-22 17:27:13 +05:30
el,
2020-11-24 15:15:51 +05:30
store,
components: {
App,
},
2021-02-22 17:27:13 +05:30
computed: {
...mapState(['open']),
},
watch: {
open() {
setNotification(el);
},
},
2020-11-24 15:15:51 +05:30
render(createElement) {
return createElement('app', {
props: {
2021-04-29 21:17:54 +05:30
versionDigest: getVersionDigest(el),
2020-11-24 15:15:51 +05:30
},
});
},
});
}
2020-10-24 23:57:45 +05:30
};