App: Remove unnecessary logic related to the `usingElectron` setting

This commit is contained in:
Svallinn 2021-06-06 18:13:36 +01:00
parent 49c4c7ac5e
commit 0bd75d558f
No known key found for this signature in database
GPG Key ID: 09FB527F34037CCA
1 changed files with 6 additions and 9 deletions

View File

@ -13,16 +13,10 @@ import $ from 'jquery'
import { markdown } from 'markdown' import { markdown } from 'markdown'
import Parser from 'rss-parser' import Parser from 'rss-parser'
let useElectron = false
let ipcRenderer = null let ipcRenderer = null
Vue.directive('observe-visibility', ObserveVisibility) Vue.directive('observe-visibility', ObserveVisibility)
if (window && window.process && window.process.type === 'renderer') {
useElectron = true
ipcRenderer = require('electron').ipcRenderer
}
export default Vue.extend({ export default Vue.extend({
name: 'App', name: 'App',
components: { components: {
@ -56,6 +50,9 @@ export default Vue.extend({
isOpen: function () { isOpen: function () {
return this.$store.getters.getIsSideNavOpen return this.$store.getters.getIsSideNavOpen
}, },
usingElectron: function() {
return this.$store.getters.getUsingElectron
},
showProgressBar: function () { showProgressBar: function () {
return this.$store.getters.getShowProgressBar return this.$store.getters.getShowProgressBar
}, },
@ -86,14 +83,14 @@ export default Vue.extend({
this.grabAllProfiles(this.$t('Profile.All Channels')).then(async () => { this.grabAllProfiles(this.$t('Profile.All Channels')).then(async () => {
this.grabHistory() this.grabHistory()
this.grabAllPlaylists() this.grabAllPlaylists()
this.setUsingElectron(useElectron)
this.checkThemeSettings() this.checkThemeSettings()
await this.checkLocale() await this.checkLocale()
this.dataReady = true this.dataReady = true
if (useElectron) { if (this.usingElectron) {
console.log('User is using Electron') console.log('User is using Electron')
ipcRenderer = require('electron').ipcRenderer
this.activateKeyboardShortcuts() this.activateKeyboardShortcuts()
this.openAllLinksExternally() this.openAllLinksExternally()
this.enableOpenUrl() this.enableOpenUrl()
@ -283,7 +280,7 @@ export default Vue.extend({
openAllLinksExternally: function () { openAllLinksExternally: function () {
$(document).on('click', 'a[href^="http"]', (event) => { $(document).on('click', 'a[href^="http"]', (event) => {
const el = event.currentTarget const el = event.currentTarget
console.log(useElectron) console.log(this.usingElectron)
console.log(el) console.log(el)
event.preventDefault() event.preventDefault()