feat: copy to clipboard (#191)

This commit is contained in:
lencx
2023-02-01 23:48:35 +08:00
parent 8eade8e9b9
commit 272ef1cd37
3 changed files with 47 additions and 17 deletions

View File

@@ -36,8 +36,22 @@ async function invoke(cmd, args) {
});
}
async function message(message) {
invoke('messageDialog', {
__tauriModule: 'Dialog',
message: {
cmd: 'messageDialog',
message: message.toString(),
title: null,
type: null,
buttonLabel: null
}
});
}
window.uid = uid;
window.invoke = invoke;
window.message = message;
window.transformCallback = transformCallback;
async function init() {
@@ -87,17 +101,6 @@ async function init() {
}
});
document.addEventListener('wheel', function(event) {
const deltaX = event.wheelDeltaX;
if (Math.abs(deltaX) >= 50) {
if (deltaX > 0) {
window.history.go(-1);
} else {
window.history.go(1);
}
}
});
if (window.location.host === 'chat.openai.com') {
window.__sync_prompts = async function() {
await invoke('sync_prompts', { time: Date.now() });