Skip to content

Commit

Permalink
Make showToast a helper (FreeTubeApp#2695)
Browse files Browse the repository at this point in the history
  • Loading branch information
absidue authored Oct 14, 2022
1 parent f94d8a9 commit 3aa080d
Show file tree
Hide file tree
Showing 29 changed files with 256 additions and 670 deletions.
14 changes: 4 additions & 10 deletions src/renderer/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { marked } from 'marked'
import Parser from 'rss-parser'
import { IpcChannels } from '../constants'
import packageDetails from '../../package.json'
import { showToast } from './helpers/utils'

let ipcRenderer = null

Expand Down Expand Up @@ -352,9 +353,7 @@ export default Vue.extend({
})
} else if (this.externalLinkHandling === 'doNothing') {
// Let user know opening external link is disabled via setting
this.showToast({
message: this.$t('External link opening has been disabled in the general settings')
})
showToast(this.$t('External link opening has been disabled in the general settings'))
} else if (this.externalLinkHandling === 'openLinkAfterPrompt') {
// Storing the URL is necessary as
// there is no other way to pass the URL to click callback
Expand Down Expand Up @@ -420,9 +419,7 @@ export default Vue.extend({
message = this.$t(message)
}

this.showToast({
message: message
})
showToast(message)
break
}

Expand All @@ -449,9 +446,7 @@ export default Vue.extend({
message = this.$t(message)
}

this.showToast({
message: message
})
showToast(message)
}
}
})
Expand Down Expand Up @@ -532,7 +527,6 @@ export default Vue.extend({
]),

...mapActions([
'showToast',
'openExternalLink',
'grabUserSettings',
'grabAllProfiles',
Expand Down
Loading

0 comments on commit 3aa080d

Please sign in to comment.