mirror of
https://github.com/TeamPiped/Piped.git
synced 2024-11-26 15:37:24 +00:00
Don't show alerts in some scenarios.
This commit is contained in:
parent
6b9151e47f
commit
adf5f7da64
@ -66,8 +66,8 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
onChange() {
|
onChange() {
|
||||||
this.setPreference("shareWithTimeCode", this.withTimeCode);
|
this.setPreference("shareWithTimeCode", this.withTimeCode, true);
|
||||||
this.setPreference("shareAsPipedLink", this.pipedLink);
|
this.setPreference("shareAsPipedLink", this.pipedLink, true);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
@ -372,13 +372,13 @@ export default {
|
|||||||
});
|
});
|
||||||
|
|
||||||
videoEl.addEventListener("volumechange", () => {
|
videoEl.addEventListener("volumechange", () => {
|
||||||
this.setPreference("volume", videoEl.volume);
|
this.setPreference("volume", videoEl.volume, true);
|
||||||
});
|
});
|
||||||
|
|
||||||
videoEl.addEventListener("ratechange", e => {
|
videoEl.addEventListener("ratechange", e => {
|
||||||
const rate = videoEl.playbackRate;
|
const rate = videoEl.playbackRate;
|
||||||
if (rate > 0 && !isNaN(videoEl.duration) && !isNaN(videoEl.duration - e.timeStamp / 1000))
|
if (rate > 0 && !isNaN(videoEl.duration) && !isNaN(videoEl.duration - e.timeStamp / 1000))
|
||||||
this.setPreference("rate", rate);
|
this.setPreference("rate", rate, true);
|
||||||
});
|
});
|
||||||
|
|
||||||
videoEl.addEventListener("ended", () => {
|
videoEl.addEventListener("ended", () => {
|
||||||
|
@ -383,7 +383,7 @@ export default {
|
|||||||
return this.fetchJson(this.apiUrl() + "/comments/" + this.getVideoId());
|
return this.fetchJson(this.apiUrl() + "/comments/" + this.getVideoId());
|
||||||
},
|
},
|
||||||
onChange() {
|
onChange() {
|
||||||
this.setPreference("autoplay", this.selectedAutoPlay);
|
this.setPreference("autoplay", this.selectedAutoPlay, true);
|
||||||
},
|
},
|
||||||
async getVideoData() {
|
async getVideoData() {
|
||||||
await this.fetchVideo()
|
await this.fetchVideo()
|
||||||
|
@ -118,11 +118,11 @@ const mixin = {
|
|||||||
purifyHTML(original) {
|
purifyHTML(original) {
|
||||||
return DOMPurify.sanitize(original);
|
return DOMPurify.sanitize(original);
|
||||||
},
|
},
|
||||||
setPreference(key, value) {
|
setPreference(key, value, disableAlert = false) {
|
||||||
try {
|
try {
|
||||||
localStorage.setItem(key, value);
|
localStorage.setItem(key, value);
|
||||||
} catch {
|
} catch {
|
||||||
alert(this.$t("info.local_storage"));
|
if (!disableAlert) alert(this.$t("info.local_storage"));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
getPreferenceBoolean(key, defaultVal) {
|
getPreferenceBoolean(key, defaultVal) {
|
||||||
|
Loading…
Reference in New Issue
Block a user