Skip to content

Commit

Permalink
feat: disable right click in production environment (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
ayangweb committed Mar 21, 2023
1 parent 3b21e6c commit 9f8c9eb
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
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

0 comments on commit 9f8c9eb

Please sign in to comment.