Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: disable right click in production environment #44

Merged
merged 1 commit into from
Mar 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 2 additions & 5 deletions .prettierrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@ module.exports = {
useTabs: false,
singleQuote: true,
semi: false,
trailingComma:
'none',
trailingComma: 'none',
bracketSpacing: true,
plugins: [
require('prettier-plugin-tailwindcss')
]
plugins: [require('prettier-plugin-tailwindcss')]
}
10 changes: 10 additions & 0 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,16 @@ onMounted(async () => {
if (!windowFocused.value && !isFix.value) appWindow.hide()
}, 100)
})

if (import.meta.env.PROD) {
document.addEventListener('contextmenu', function (event) {
const selectedText = window.getSelection()?.toString()

if (!selectedText) {
event.preventDefault()
}
})
}
})
</script>

Expand Down
1 change: 0 additions & 1 deletion src/api/openAi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { Body } from '@tauri-apps/api/http'
import { Message } from '@arco-design/web-vue'
import { request } from '.'
import { OPEN_AI_MODEL } from '@/constants'
import { dialogErrorMessage } from '@/utils'
import {
fetchEventSource,
type EventSourceMessage
Expand Down
6 changes: 3 additions & 3 deletions src/components/Session/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@
::v-deep(.session-item) {
pre {
--uno: m0;

code {
--uno: rounded-md leading-6;
}

+ .code-copy {
background: url('@/assets/image/copy.svg') no-repeat center;
background-size: contain;
background-image: url('@/assets/image/copy.svg');

--uno: transition-300 absolute top-2 right-2 h-6 w-6 cursor-pointer
text-white opacity-0;
bg-contain bg-center bg-no-repeat text-white opacity-0;

&:hover {
--uno: opacity-100;
Expand Down