Fix play button on public pages.
This commit is contained in:
parent
37dc95b7d9
commit
b8a825b8ea
|
@ -3,6 +3,7 @@ import axios from 'axios';
|
||||||
import VueAxios from 'vue-axios';
|
import VueAxios from 'vue-axios';
|
||||||
import GetTextPlugin from 'vue-gettext';
|
import GetTextPlugin from 'vue-gettext';
|
||||||
import translations from '../../translations/translations.json';
|
import translations from '../../translations/translations.json';
|
||||||
|
import pinia from './vendor/pinia';
|
||||||
|
|
||||||
document.addEventListener('DOMContentLoaded', function () {
|
document.addEventListener('DOMContentLoaded', function () {
|
||||||
// Configure localization
|
// Configure localization
|
||||||
|
@ -29,28 +30,29 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||||
export default function (component) {
|
export default function (component) {
|
||||||
return function (el, props) {
|
return function (el, props) {
|
||||||
return new Vue({
|
return new Vue({
|
||||||
el: el,
|
el: el,
|
||||||
created () {
|
pinia,
|
||||||
let handleAxiosError = (error) => {
|
created() {
|
||||||
let notifyMessage = this.$gettext('An error occurred and your request could not be completed.');
|
let handleAxiosError = (error) => {
|
||||||
if (error.response) {
|
let notifyMessage = this.$gettext('An error occurred and your request could not be completed.');
|
||||||
// Request made and server responded
|
if (error.response) {
|
||||||
notifyMessage = error.response.data.message;
|
// Request made and server responded
|
||||||
console.error(notifyMessage);
|
notifyMessage = error.response.data.message;
|
||||||
} else if (error.request) {
|
console.error(notifyMessage);
|
||||||
// The request was made but no response was received
|
} else if (error.request) {
|
||||||
console.error(error.request);
|
// The request was made but no response was received
|
||||||
} else {
|
console.error(error.request);
|
||||||
// Something happened in setting up the request that triggered an Error
|
} else {
|
||||||
console.error('Error', error.message);
|
// Something happened in setting up the request that triggered an Error
|
||||||
}
|
console.error('Error', error.message);
|
||||||
|
}
|
||||||
|
|
||||||
if (typeof this.$notifyError === 'function') {
|
if (typeof this.$notifyError === 'function') {
|
||||||
this.$notifyError(notifyMessage);
|
this.$notifyError(notifyMessage);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
axios.interceptors.request.use((config) => {
|
axios.interceptors.request.use((config) => {
|
||||||
return config;
|
return config;
|
||||||
}, (error) => {
|
}, (error) => {
|
||||||
handleAxiosError(error);
|
handleAxiosError(error);
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
import Vue from 'vue';
|
import Vue from 'vue';
|
||||||
import InlinePlayer from '~/components/InlinePlayer.vue';
|
import InlinePlayer from '~/components/InlinePlayer.vue';
|
||||||
import {createPinia, PiniaVuePlugin} from 'pinia';
|
import pinia from '../vendor/pinia';
|
||||||
|
|
||||||
Vue.use(PiniaVuePlugin);
|
|
||||||
const pinia = createPinia();
|
|
||||||
|
|
||||||
document.addEventListener('DOMContentLoaded', function () {
|
document.addEventListener('DOMContentLoaded', function () {
|
||||||
let inlinePlayer = new Vue({
|
let inlinePlayer = new Vue({
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
import Vue from 'vue';
|
||||||
|
import {createPinia, PiniaVuePlugin} from 'pinia';
|
||||||
|
|
||||||
|
Vue.use(PiniaVuePlugin);
|
||||||
|
const pinia = createPinia();
|
||||||
|
|
||||||
|
export default pinia;
|
Loading…
Reference in New Issue