Disable settings depending on others and move default profile logic
This commit is contained in:
parent
5fd64afdb2
commit
382405cdfe
|
@ -70,6 +70,15 @@ export default Vue.extend({
|
|||
},
|
||||
searchSettings: function () {
|
||||
return this.$store.getters.getSearchSettings
|
||||
},
|
||||
profileList: function () {
|
||||
return this.$store.getters.getProfileList
|
||||
},
|
||||
activeProfile: function () {
|
||||
return this.$store.getters.getActiveProfile
|
||||
},
|
||||
defaultProfile: function () {
|
||||
return this.$store.getters.getDefaultProfile
|
||||
}
|
||||
},
|
||||
mounted: function () {
|
||||
|
@ -256,8 +265,6 @@ export default Vue.extend({
|
|||
enableCliPing: function () {
|
||||
const v = this
|
||||
electron.ipcRenderer.on('ping', function (event, message) {
|
||||
console.log('ping!')
|
||||
console.log(message)
|
||||
let url = message[message.length - 1]
|
||||
if (url) {
|
||||
url = url.replace('freetube://', '')
|
||||
|
|
|
@ -42,6 +42,15 @@ export default Vue.extend({
|
|||
}
|
||||
},
|
||||
methods: {
|
||||
handleHideRecommendedVideos: function (value) {
|
||||
if (value) {
|
||||
this.updatePlayNextVideo(false)
|
||||
this.updateDefaultTheatreMode(true)
|
||||
}
|
||||
|
||||
this.updateHideRecommendedVideos(value)
|
||||
},
|
||||
|
||||
...mapActions([
|
||||
'updateHideVideoViews',
|
||||
'updateHideVideoLikesAndDislikes',
|
||||
|
@ -50,7 +59,9 @@ export default Vue.extend({
|
|||
'updateHideRecommendedVideos',
|
||||
'updateHideTrendingVideos',
|
||||
'updateHidePopularVideos',
|
||||
'updateHideLiveChat'
|
||||
'updateHideLiveChat',
|
||||
'updatePlayNextVideo',
|
||||
'updateDefaultTheatreMode'
|
||||
])
|
||||
}
|
||||
})
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
:label="$t('Settings.Distraction Free Settings.Hide Recommended Videos')"
|
||||
:compact="true"
|
||||
:default-value="hideRecommendedVideos"
|
||||
@change="updateHideRecommendedVideos"
|
||||
@change="handleHideRecommendedVideos"
|
||||
/>
|
||||
<ft-toggle-switch
|
||||
:label="$t('Settings.Distraction Free Settings.Hide Trending Videos')"
|
||||
|
|
|
@ -36,16 +36,6 @@ export default Vue.extend({
|
|||
}
|
||||
},
|
||||
mounted: function () {
|
||||
setTimeout(() => {
|
||||
const profileIndex = this.profileList.findIndex((profile) => {
|
||||
return profile._id === this.defaultProfile
|
||||
})
|
||||
|
||||
if (profileIndex !== -1) {
|
||||
this.updateActiveProfile(profileIndex)
|
||||
}
|
||||
}, 200)
|
||||
|
||||
$('#profileList').focusout(() => {
|
||||
$('#profileList')[0].style.display = 'none'
|
||||
})
|
||||
|
|
|
@ -14,6 +14,10 @@ export default Vue.extend({
|
|||
compact: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data: function () {
|
||||
|
|
|
@ -50,6 +50,9 @@
|
|||
.switch-input:checked + &
|
||||
background-color: var(--accent-color-light)
|
||||
|
||||
.switch-input:disabled + &
|
||||
background-color: #9E9E9E
|
||||
|
||||
&:after
|
||||
left: 0
|
||||
width: 20px
|
||||
|
@ -63,3 +66,6 @@
|
|||
-ms-transform: translate(80%, -50%)
|
||||
-webkit-transform: translate(80%, -50%)
|
||||
transform: translate(80%, -50%)
|
||||
|
||||
.switch-input:disabled + &
|
||||
background-color: #BDBDBD
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
name="set-name"
|
||||
class="switch-input"
|
||||
:checked="currentValue"
|
||||
:disabled="disabled"
|
||||
@change="$emit('change', currentValue)"
|
||||
>
|
||||
<label
|
||||
|
|
|
@ -78,6 +78,10 @@ export default Vue.extend({
|
|||
return this.$store.getters.getDefaultTheatreMode
|
||||
},
|
||||
|
||||
hideRecommendedVideos: function () {
|
||||
return this.$store.getters.getHideRecommendedVideos
|
||||
},
|
||||
|
||||
formatNames: function () {
|
||||
return [
|
||||
this.$t('Settings.Player Settings.Default Video Format.Dash Formats'),
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
<ft-toggle-switch
|
||||
:label="$t('Settings.Player Settings.Enable Theatre Mode by Default')"
|
||||
:compact="true"
|
||||
:disabled="hideRecommendedVideos"
|
||||
:default-value="defaultTheatreMode"
|
||||
@change="updateDefaultTheatreMode"
|
||||
/>
|
||||
|
@ -51,6 +52,7 @@
|
|||
<ft-toggle-switch
|
||||
:label="$t('Settings.Player Settings.Play Next Video')"
|
||||
:compact="true"
|
||||
:disabled="hideRecommendedVideos"
|
||||
:default-value="playNextVideo"
|
||||
@change="updatePlayNextVideo"
|
||||
/>
|
||||
|
|
|
@ -58,6 +58,14 @@ export default Vue.extend({
|
|||
}
|
||||
},
|
||||
|
||||
handleRememberHistory: function (value) {
|
||||
if (!value) {
|
||||
this.updateSaveWatchedProgress(false)
|
||||
}
|
||||
|
||||
this.updateRememberHistory(value)
|
||||
},
|
||||
|
||||
handleRemoveHistory: function (option) {
|
||||
this.showRemoveHistoryPrompt = false
|
||||
|
||||
|
|
|
@ -11,13 +11,14 @@
|
|||
:label="$t('Settings.Privacy Settings.Remember History')"
|
||||
:compact="true"
|
||||
:default-value="rememberHistory"
|
||||
@change="updateRememberHistory"
|
||||
@change="handleRememberHistory"
|
||||
/>
|
||||
</div>
|
||||
<div class="switchColumn">
|
||||
<ft-toggle-switch
|
||||
:label="$t('Settings.Privacy Settings.Save Watched Progress')"
|
||||
:compact="true"
|
||||
:disabled="!rememberHistory"
|
||||
:default-value="saveWatchedProgress"
|
||||
@change="updateSaveWatchedProgress"
|
||||
/>
|
||||
|
|
|
@ -95,6 +95,10 @@ export default Vue.extend({
|
|||
return this.$store.getters.getActiveProfile
|
||||
},
|
||||
|
||||
hideRecommendedVideos: function () {
|
||||
return this.$store.getters.getHideRecommendedVideos
|
||||
},
|
||||
|
||||
formatTypeNames: function () {
|
||||
return [
|
||||
this.$t('Change Format.Use Dash Formats').toUpperCase(),
|
||||
|
|
|
@ -60,6 +60,7 @@
|
|||
</div>
|
||||
<div class="videoOptions">
|
||||
<ft-icon-button
|
||||
v-if="!hideRecommendedVideos"
|
||||
:title="$t('Toggle Theatre Mode')"
|
||||
class="theatreModeButton option"
|
||||
icon="expand-alt"
|
||||
|
|
|
@ -46,7 +46,7 @@ const getters = {
|
|||
}
|
||||
|
||||
const actions = {
|
||||
grabAllProfiles ({ dispatch, commit }, defaultName = null) {
|
||||
grabAllProfiles ({ rootState, dispatch, commit }, defaultName = null) {
|
||||
profileDb.find({}, (err, results) => {
|
||||
if (!err) {
|
||||
if (results.length === 0) {
|
||||
|
@ -65,6 +65,17 @@ const actions = {
|
|||
|
||||
return b.name - a.name
|
||||
})
|
||||
|
||||
if (state.profileList.length < profiles.length) {
|
||||
const profileIndex = profiles.findIndex((profile) => {
|
||||
return profile._id === rootState.settings.defaultProfile
|
||||
})
|
||||
|
||||
if (profileIndex !== -1) {
|
||||
dispatch('updateActiveProfile', profileIndex)
|
||||
}
|
||||
}
|
||||
|
||||
commit('setProfileList', profiles)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue