fix legacy broswer issues on iOS

pull/52/head
Akhil Gupta 4 years ago
parent cca6d63358
commit aa946712e0

@ -189,8 +189,8 @@
item.already_saved = true;
})
.catch(function (error) {
if (error.response) {
Vue.toasted.show(error.response.data?.message, {
if (error.response && error.response.data && error.response.data.message) {
Vue.toasted.show(error.response.data.message, {
theme: "bubble",
type: "error",
position: "top-right",
@ -246,8 +246,8 @@
item.already_saved = true;
})
.catch(function (error) {
if (error.response) {
Vue.toasted.show(error.response.data?.message, {
if (error.response && error.response.data && error.response.data.message) {
Vue.toasted.show(error.response.data.message, {
theme: "bubble",
type: "error",
position: "top-right",

@ -221,8 +221,8 @@
row.remove();
})
.catch(function (error) {
if (error.response) {
Vue.toasted.show(error.response.data?.message, {
if (error.response && error.response.data && error.response.data.message) {
Vue.toasted.show(error.response.data.message, {
theme: "bubble",
type: "error",
position: "top-right",
@ -247,8 +247,8 @@
row.remove();
})
.catch(function (error) {
if (error.response) {
Vue.toasted.show(error.response.data?.message, {
if (error.response && error.response.data && error.response.data.message) {
Vue.toasted.show(error.response.data.message, {
theme: "bubble",
type: "error",
position: "top-right",
@ -276,8 +276,9 @@
row.remove();
})
.catch(function (error) {
if (error.response) {
Vue.toasted.show(error.response.data?.message, {
if (error.response && error.response.data && error.response.data.message) {
Vue.toasted.show(error.response.data.message, {
theme: "bubble",
type: "error",
position: "top-right",
@ -306,8 +307,8 @@
row.remove();
})
.catch(function (error) {
if (error.response) {
Vue.toasted.show(error.response.data?.message, {
if (error.response && error.response.data && error.response.data.message) {
Vue.toasted.show(error.response.data.message, {
theme: "bubble",
type: "error",
position: "top-right",

@ -321,11 +321,11 @@
playPodcast(id){openPlayer("",id)},
},
mounted(){
if(localStorage?.sortOrder){
if(localStorage && localStorage.sortOrder){
this.sortOrder=localStorage.sortOrder;
this.sortPodcasts(this.sortOrder);
}
if(localStorage?.layout){
if(localStorage && localStorage.layout){
this.layout=localStorage.layout;
}else{
this.layout='list';
@ -436,8 +436,9 @@
);
})
.catch(function (error) {
if (error.response) {
Vue.toasted.show(error.response.data?.message, {
if (error.response && error.response.data && error.response.data.message) {
Vue.toasted.show(error.response.data.message, {
theme: "bubble",
type: "error",
position: "top-right",
@ -472,8 +473,9 @@
})
.catch(function (error) {
if (error.response) {
Vue.toasted.show(error.response.data?.message, {
if (error.response && error.response.data && error.response.data.message) {
Vue.toasted.show(error.response.data.message, {
theme: "bubble",
type: "error",
position: "top-right",
@ -507,8 +509,9 @@
});
})
.catch(function (error) {
if (error.response) {
Vue.toasted.show(error.response.data?.message, {
if (error.response && error.response.data && error.response.data.message) {
Vue.toasted.show(error.response.data.message, {
theme: "bubble",
type: "error",
position: "top-right",
@ -542,8 +545,9 @@
app.removePodcast(id)
})
.catch(function (error) {
if (error.response) {
Vue.toasted.show(error.response.data?.message, {
if (error.response && error.response.data && error.response.data.message) {
Vue.toasted.show(error.response.data.message, {
theme: "bubble",
type: "error",
position: "top-right",

@ -174,8 +174,8 @@ div#overlay{
<script>
function toggleMenu(){
let sideDrawer= document.getElementById('sideDrawer')
let overlay= document.getElementById('overlay')
var sideDrawer= document.getElementById('sideDrawer')
var overlay= document.getElementById('overlay')
if(overlay.style.display==="block"){
sideDrawer.style.left="-160px"
overlay.style.display="none"

@ -934,7 +934,7 @@ div#large-visualization{
},
mounted(){
var volume=50;
if(localStorage?.playerVolume){
if(localStorage && localStorage.playerVolume){
volume=parseInt(localStorage.playerVolume)
}
const self=this;

@ -177,9 +177,10 @@ function downloadToDisk(id){
row.remove();
})
.catch(function(error){
if(error.response){
if (error.response && error.response.data && error.response.data.message) {
Vue.toasted.show(error.response.data?.message, {
Vue.toasted.show(error.response.data.message, {
theme: "bubble",
position: "top-right",
type: "error",

@ -10,24 +10,24 @@
};
const limit = 300;
function checkUseMore() {
let elements = document.getElementsByClassName("useMore");
var elements = document.getElementsByClassName("useMore");
for (let index = 0; index < elements.length; index++) {
for (var index = 0; index < elements.length; index++) {
const element = elements[index];
let display = element.style.display;
let originalText = element.textContent;
var display = element.style.display;
var originalText = element.textContent;
if (originalText.length <= limit) {
continue;
}
let newText = originalText.substr(0, limit);
var newText = originalText.substr(0, limit);
let newElement = document.createElement(element.tagName);
var newElement = document.createElement(element.tagName);
newElement.textContent = newText;
newElement.classList.add("short-version");
element.classList.add("long-version");
let more = document.createElement("a");
var more = document.createElement("a");
more.textContent = " show more";
more.style.cursor = "pointer";
more.onclick = function () {
@ -35,7 +35,7 @@
newElement.style.display = "none";
};
let less = document.createElement("a");
var less = document.createElement("a");
less.textContent = " show less";
less.style.cursor = "pointer";
less.onclick = function () {
@ -53,7 +53,7 @@
checkUseMore();
function openPlayer(itemId, podcastId) {
let url = "/player?";
var url = "/player?";
if (itemId) {
url += "&itemId=" + itemId;
}
@ -66,7 +66,7 @@
function getIdentifier() {
if(localStorage){
if (localStorage.identifier) {
return localStorage?.identifier;
return localStorage.identifier;
}
var id = +new Date();
localStorage.identifier = id;

@ -151,9 +151,10 @@ var app = new Vue({
}
})
.catch(function(error){
if(error.response){
if (error.response && error.response.data && error.response.data.message) {
Vue.toasted.show(error.response.data?.message, {
Vue.toasted.show(error.response.data.message, {
theme: "bubble",
type: "error",
position: "top-right",

Loading…
Cancel
Save