mirror of
https://github.com/h3poteto/whalebird-desktop
synced 2025-01-30 17:15:16 +01:00
Fix broken clipboard
This commit is contained in:
parent
52e1c7e1fb
commit
2a2ebfd0ae
@ -14,7 +14,8 @@ import {
|
||||
nativeTheme,
|
||||
IpcMainInvokeEvent,
|
||||
Notification,
|
||||
NotificationConstructorOptions
|
||||
NotificationConstructorOptions,
|
||||
clipboard
|
||||
} from 'electron'
|
||||
import fs from 'fs'
|
||||
import crypto from 'crypto'
|
||||
@ -1445,3 +1446,7 @@ ipcMain.on('start-tag-streaming', async (event: IpcMainEvent, obj: TagStreamingO
|
||||
ipcMain.handle('open-browser', async (_: IpcMainInvokeEvent, url: string) => {
|
||||
shell.openExternal(url)
|
||||
})
|
||||
|
||||
ipcMain.handle('copy-text', async (_: IpcMainInvokeEvent, text: string) => {
|
||||
clipboard.writeText(text)
|
||||
})
|
||||
|
@ -1,7 +1,5 @@
|
||||
const electron = require('electron')
|
||||
|
||||
global.ipcRenderer = electron.ipcRenderer
|
||||
global.shell = electron.shell
|
||||
global.clipboard = electron.clipboard
|
||||
global.node_env = process.env.NODE_ENV
|
||||
global.platform = process.platform
|
||||
|
@ -522,7 +522,7 @@ export default defineComponent({
|
||||
win.ipcRenderer.invoke('open-browser', message.url)
|
||||
}
|
||||
const copyLink = (message: Entity.Status) => {
|
||||
;(window as any).clipboard.writeText(message.url, 'toot-link')
|
||||
win.ipcRenderer.invoke('copy-text', message.url)
|
||||
}
|
||||
const reportUser = () => {
|
||||
store.dispatch(`TimelineSpace/Modals/Report/${REPORT_ACTION.OPEN_REPORT}`, originalMessage.value)
|
||||
|
Loading…
x
Reference in New Issue
Block a user