Spaces:
Paused
Paused
Download src/views/chat/hooks/useUsingContext.ts from imseldrith/chatgpt-web: direct link, hf CLI and curl.
- Browser
- Download file 465 Bytes
-
https://huggingface.co/spaces/imseldrith/chatgpt-web/resolve/main/src/views/chat/hooks/useUsingContext.ts
- Command line
-
hf download hf://spaces/imseldrith/chatgpt-web/src/views/chat/hooks/useUsingContext.ts
-
curl -L -o useUsingContext.ts https://huggingface.co/spaces/imseldrith/chatgpt-web/resolve/main/src/views/chat/hooks/useUsingContext.ts
465 Bytes
| import { ref } from 'vue' | |
| import { useMessage } from 'naive-ui' | |
| import { t } from '@/locales' | |
| export function useUsingContext() { | |
| const ms = useMessage() | |
| const usingContext = ref<boolean>(true) | |
| function toggleUsingContext() { | |
| usingContext.value = !usingContext.value | |
| if (usingContext.value) | |
| ms.success(t('chat.turnOnContext')) | |
| else | |
| ms.warning(t('chat.turnOffContext')) | |
| } | |
| return { | |
| usingContext, | |
| toggleUsingContext, | |
| } | |
| } | |