Skip to content

Commit 1f3812b

Browse files
author
Kevin Souza
committed
fix subscription notify and deep link
1 parent 6c08a8e commit 1f3812b

3 files changed

Lines changed: 10 additions & 7 deletions

File tree

src/main/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function createWindow(url?: string): void {
3636
if (is.dev && process.env['ELECTRON_RENDERER_URL']) {
3737
window.loadURL(`${process.env['ELECTRON_RENDERER_URL']}?view=${view}&path=${path}`)
3838
} else {
39-
const query: Record<string, string> = { view: view, path: path ?? '' }
39+
const query: Record<string, string> = { view: view, path: path }
4040
window.loadFile(join(__dirname, '../renderer/index.html'), { query: query })
4141
}
4242

@@ -118,7 +118,8 @@ if (!gotTheLock) {
118118
})
119119

120120
app.whenReady().then(() => {
121-
createWindow()
121+
const url = process.argv.find((arg) => arg.startsWith('rt://'))
122+
createWindow(url)
122123
})
123124

124125
app.on('window-all-closed', () => {

src/renderer/src/App.svelte

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,16 @@
4040
const view = url.searchParams.get('view') as View
4141
const path = url.searchParams.get('path') ?? ''
4242
43+
if (path) {
44+
changeView(view, true, path)
45+
return
46+
}
47+
4348
const lastView = localStorage.getItem('lastView') as View
4449
45-
if (lastView !== view && !path) {
50+
if (lastView !== view) {
4651
changeView(lastView)
47-
return
4852
}
49-
50-
changeView(view, true, path)
5153
})
5254
</script>
5355

src/renderer/src/pages/streams/Watch.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
subscribed = false
6363
} else {
6464
const deleted = await window.user.add(Platform.Twitch, username)
65-
notify(`Subscribed to ${deleted}`)
65+
notify(`Subscribed to ${deleted.username}`)
6666
subscribed = true
6767
}
6868
} catch (err) {

0 commit comments

Comments
 (0)