Skip to content

Commit

Permalink
always open freetube:// links in new window
Browse files Browse the repository at this point in the history
  • Loading branch information
OothecaPickle committed Nov 29, 2024
1 parent 7f7feab commit 6424a63
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 33 deletions.
16 changes: 2 additions & 14 deletions src/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,6 @@ function runApp() {
let mainWindow
let startupUrl

function isOpenLinkInNewWindow() {
return sessionStorage.getItem('openLinkInNewWindow') === 'true'
}

if (process.platform === 'linux') {
// Enable hardware acceleration via VA-API with OpenGL if no other feature flags are found
// https://chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/gpu/vaapi.md
Expand Down Expand Up @@ -835,11 +831,7 @@ function runApp() {

ipcMain.once(IpcChannels.APP_READY, () => {
if (startupUrl) {
if (isOpenLinkInNewWindow()) {
createWindow({ replaceMainWindow: false, windowStartupUrl: startupUrl, showWindowNow: true })
} else {
mainWindow.webContents.send(IpcChannels.OPEN_URL, startupUrl)
}
createWindow({ replaceMainWindow: false, windowStartupUrl: startupUrl, showWindowNow: true })
}
})

Expand Down Expand Up @@ -1498,11 +1490,7 @@ function runApp() {
const startUrl = baseUrl(url)

if (mainWindow && mainWindow.webContents) {
if (isOpenLinkInNewWindow()) {
createWindow({ replaceMainWindow: false, windowStartupUrl: startUrl, showWindowNow: true })
} else {
mainWindow.webContents.send(IpcChannels.OPEN_URL, startUrl)
}
createWindow({ replaceMainWindow: false, windowStartupUrl: startUrl, showWindowNow: true })
} else {
startupUrl = startUrl
}
Expand Down
5 changes: 0 additions & 5 deletions src/renderer/components/general-settings/general-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,6 @@ export default defineComponent({
this.$t('Settings.General Settings.External Link Handling.Ask Before Opening Link'),
this.$t('Settings.General Settings.External Link Handling.No Action')
]
},

openLinkInNewWindow: function () {
return this.$store.getters.getEnableOpenLinkInNewWindow
}
},
created: function () {
Expand Down Expand Up @@ -273,7 +269,6 @@ export default defineComponent({
'updateCurrentLocale',
'updateExternalLinkHandling',
'updateGeneralAutoLoadMorePaginatedItemsEnabled',
'updateEnableOpenLinkInNewWindow',
])
}
})
6 changes: 0 additions & 6 deletions src/renderer/components/general-settings/general-settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,6 @@
:compact="true"
@change="updateEnableSearchSuggestions"
/>
<ft-toggle-switch
:label="$t('Settings.General Settings.Enable Open Link In New Window')"
:default-value="enableOpenLinkInNewWindow"
:compact="true"
@change="updateEnableOpenLinkInNewWindow"
/>
</div>
</div>
<div class="switchGrid">
Expand Down
7 changes: 0 additions & 7 deletions src/renderer/store/modules/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -404,13 +404,6 @@ const stateWithSideEffects = {
}
},

openLinkInNewWindow: {
defaultValue: false,
sideEffectsHandler: (_, value) => {
sessionStorage.setItem('openLinkInNewWindow', value)
}
},

uiScale: {
defaultValue: 100,
sideEffectsHandler: (_, value) => {
Expand Down
1 change: 0 additions & 1 deletion static/locales/en-US.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,6 @@ Settings:
Fallback to Non-Preferred Backend on Failure: Fallback to Non-Preferred Backend
on Failure
Enable Search Suggestions: Enable Search Suggestions
Enable Link In New Window: Enable opening freetube:// links in a new window
Auto Load Next Page:
Label: Auto Load Next Page
Tooltip: Load additional pages and comments automatically.
Expand Down

0 comments on commit 6424a63

Please sign in to comment.