mirror of
https://github.com/ThaUnknown/miru.git
synced 2026-04-18 22:22:04 +00:00
Merge pull request #178 from Muril-o/177-fix
fix: #177 [Bug]: Select Folder button for torrent path not working
This commit is contained in:
commit
9f99b4e235
2 changed files with 11 additions and 3 deletions
|
|
@ -7,6 +7,9 @@ contextBridge.exposeInMainWorld('IPC', {
|
|||
},
|
||||
on: (event, callback) => {
|
||||
ipcRenderer.on(event, (event, ...args) => callback(...args))
|
||||
},
|
||||
off: (event) => {
|
||||
ipcRenderer.removeAllListeners(event)
|
||||
}
|
||||
})
|
||||
contextBridge.exposeInMainWorld('version', {
|
||||
|
|
|
|||
|
|
@ -16,9 +16,6 @@
|
|||
}
|
||||
localStorage.removeItem('relations') // TODO: remove
|
||||
export let set = JSON.parse(localStorage.getItem('settings')) || { ...defaults }
|
||||
window.IPC.on('path', data => {
|
||||
set.torrentPath = data
|
||||
})
|
||||
window.addEventListener('paste', ({ clipboardData }) => {
|
||||
if (clipboardData.items?.[0]) {
|
||||
if (clipboardData.items[0].type === 'text/plain' && clipboardData.items[0].kind === 'string') {
|
||||
|
|
@ -54,6 +51,11 @@
|
|||
|
||||
<script>
|
||||
import { Tabs, TabLabel, Tab } from '../Tabination.js'
|
||||
import { onDestroy } from 'svelte'
|
||||
|
||||
onDestroy(() => {
|
||||
window.IPC.off('path')
|
||||
})
|
||||
|
||||
const groups = {
|
||||
player: {
|
||||
|
|
@ -84,6 +86,9 @@
|
|||
function handleFolder() {
|
||||
window.IPC.emit('dialog')
|
||||
}
|
||||
window.IPC.on('path', data => {
|
||||
settings.torrentPath = data
|
||||
})
|
||||
</script>
|
||||
|
||||
<Tabs>
|
||||
|
|
|
|||
Loading…
Reference in a new issue