Compare commits

2 Commits

Author SHA1 Message Date
ChenZhaoYu
7a8dc393b5 fix: 移动端新建会话关闭侧边栏 2023-03-23 16:22:06 +08:00
Bing
5fca2e9fa3 fix: PWA 未添加的问题 (#807)
Co-authored-by: bingo235 <>
2023-03-23 15:55:51 +08:00
2 changed files with 7 additions and 7 deletions

View File

@@ -18,6 +18,8 @@ const collapsed = computed(() => appStore.siderCollapsed)
function handleAdd() { function handleAdd() {
chatStore.addHistory({ title: 'New Chat', uuid: Date.now(), isEdit: false }) chatStore.addHistory({ title: 'New Chat', uuid: Date.now(), isEdit: false })
if (isMobile.value)
appStore.setSiderCollapsed(true)
} }
function handleUpdateCollapsed() { function handleUpdateCollapsed() {

View File

@@ -5,10 +5,9 @@ import vue from '@vitejs/plugin-vue'
import { VitePWA } from 'vite-plugin-pwa' import { VitePWA } from 'vite-plugin-pwa'
function setupPlugins(env: ImportMetaEnv): PluginOption[] { function setupPlugins(env: ImportMetaEnv): PluginOption[] {
const plugins = [vue()] return [
vue(),
if (env.VITE_GLOB_APP_PWA === 'true') { env.VITE_GLOB_APP_PWA === 'true' && VitePWA({
VitePWA({
injectRegister: 'auto', injectRegister: 'auto',
manifest: { manifest: {
name: 'chatGPT', name: 'chatGPT',
@@ -18,9 +17,8 @@ function setupPlugins(env: ImportMetaEnv): PluginOption[] {
{ src: 'pwa-512x512.png', sizes: '512x512', type: 'image/png' }, { src: 'pwa-512x512.png', sizes: '512x512', type: 'image/png' },
], ],
}, },
}) }),
} ]
return plugins
} }
export default defineConfig((env) => { export default defineConfig((env) => {