diff --git a/apps/nuxt/app/assets/css/main.scss b/apps/nuxt/app/assets/css/main.scss index 3a0a1abd..5880d42a 100644 --- a/apps/nuxt/app/assets/css/main.scss +++ b/apps/nuxt/app/assets/css/main.scss @@ -121,7 +121,7 @@ html.dark { --color-line: rgb(66, 66, 66); } -@media (max-width: 1720px) { +@media (max-width: 1706px) { :root { --toolbar-width: 50vw; --panel-width: 20rem; @@ -133,9 +133,9 @@ html.dark { } } -@media (max-width: 1560px) { +@media (max-width: 1439px) { :root { - --panel-width: 24rem; + --panel-width: 25rem; --toolbar-width: 60vw; --article-width: 60vw; --article-toolbar-width: 60vw; @@ -148,8 +148,6 @@ html.dark { --toolbar-width: 70vw; --stat-gap: 0.5rem; --space: 0.3rem; - - --article-width: 70vw; --article-toolbar-width: 70vw; } diff --git a/apps/nuxt/app/layouts/default.vue b/apps/nuxt/app/layouts/default.vue index a42ead6e..91881bf4 100644 --- a/apps/nuxt/app/layouts/default.vue +++ b/apps/nuxt/app/layouts/default.vue @@ -14,6 +14,7 @@ import 'vue-virtual-scroller/dist/vue-virtual-scroller.css' import { useInit } from '@typewords/core/composables/useInit.ts' import { useI18n } from 'vue-i18n' import { Supabase } from '@typewords/core/utils/supabase.ts' +import MiniProgram from '@/components/MiniProgram.vue' const router = useRouter() const { toggleTheme, getTheme, setTheme } = useTheme() @@ -161,7 +162,7 @@ onMounted(() => {
- +
diff --git a/apps/nuxt/app/pages/(articles)/book/[id].vue b/apps/nuxt/app/pages/(articles)/book/[id].vue index 87350823..d9774006 100644 --- a/apps/nuxt/app/pages/(articles)/book/[id].vue +++ b/apps/nuxt/app/pages/(articles)/book/[id].vue @@ -64,12 +64,12 @@ async function startPractice() { if (cache) { let currentArticle = store.sbook.articles[store.sbook.lastLearnIndex] let data: Partial & { title: string; articleId: number } = { - articleId: Number(currentArticle.id), - title: currentArticle.title, - spend: cache.statStoreData.spend, - startDate: cache.statStoreData.startDate, - total: cache.statStoreData.total, - wrong: cache.statStoreData.wrong, + articleId: Number(currentArticle?.id), + title: currentArticle?.title, + spend: cache?.statStoreData?.spend, + startDate: cache?.statStoreData?.startDate, + total: cache?.statStoreData?.total, + wrong: cache?.statStoreData?.wrong, } store.sbook.statistics.push(data as any) await practice.clear() diff --git a/apps/nuxt/app/pages/index.vue b/apps/nuxt/app/pages/index.vue index a83627ab..2c4c2a9b 100644 --- a/apps/nuxt/app/pages/index.vue +++ b/apps/nuxt/app/pages/index.vue @@ -461,7 +461,7 @@ let mobileMenuOpen = $ref(false) target="_blank" >查看源码 - +
diff --git a/apps/nuxt/app/pages/setting.vue b/apps/nuxt/app/pages/setting.vue index c37746c1..7e2fb0c7 100644 --- a/apps/nuxt/app/pages/setting.vue +++ b/apps/nuxt/app/pages/setting.vue @@ -49,7 +49,6 @@ import SettingItem from '@typewords/core/components/setting/SettingItem.vue' import { Supabase } from '@typewords/core/utils/supabase.ts' import BackupGateDialog from '@typewords/core/components/dialog/BackupGateDialog.vue' - import { createClient } from '@supabase/supabase-js' import { useRoute } from 'vue-router' import type { BackupData, Snapshot } from '@typewords/core' @@ -443,6 +442,9 @@ function transferOk() { async function clearAllData() { await dataSyncPersistence.clear() Supabase.removeConfig() + sbForm.url = '' + sbForm.key = '' + sbStatus = { status: 'idle', statusMessage: undefined } Toast.success('清除成功') } @@ -524,6 +526,7 @@ async function doSaveSbConfig() { } else { Supabase.setStatus('success') sbStatus = Supabase.getStatus() + await onSbFirstSyncChoice('push_local') Toast.success('保存成功') Supabase.saveConfig(sbForm?.url, sbForm?.key) transferOk() @@ -677,7 +680,9 @@ function removeSbConfig() {
- 状态:同步正常运行中,数据已同步到云端 + 状态:同步正常运行中,数据已同步到云端 同步状态:失败{{ sbStatus.statusMessage ? `(${sbStatus.statusMessage})` : '' }} @@ -767,7 +772,7 @@ function removeSbConfig() {
-
Build {{ gitLastCommitHash }} {{gitLastCommitTime}}
+
Build {{ gitLastCommitHash }} {{ gitLastCommitTime }}
@@ -808,9 +813,9 @@ function removeSbConfig() {
暂无历史数据
这里是每次 {{ APP_NAME }} 更新后/报错后自动保存的用户数据,如果您的数据被损坏,您可在此尝试恢复
-
+
-
{{ i+1 }}. 版本号:{{ item.hash }}
+
{{ i + 1 }}. 版本号:{{ item.hash }}
自动备份时间:{{ formatHistoryTime(item.createdAt) }}
diff --git a/packages/core/src/components/PracticeLayout.vue b/packages/core/src/components/PracticeLayout.vue index 808cbc48..4bd746f3 100644 --- a/packages/core/src/components/PracticeLayout.vue +++ b/packages/core/src/components/PracticeLayout.vue @@ -51,7 +51,7 @@ defineProps<{ height: calc(100vh - 1.8rem); } -@media (max-width: 1560px) { +@media (max-width: 1439px) { .panel-wrap { position: fixed; top: 0; diff --git a/packages/core/src/utils/cache.ts b/packages/core/src/utils/cache.ts index 9fd10efb..69ba2233 100644 --- a/packages/core/src/utils/cache.ts +++ b/packages/core/src/utils/cache.ts @@ -89,7 +89,10 @@ async function getLocalWithMeta(config: CacheConfig): Promise(config: CacheConfig): Promise { const result = await getLocalWithMeta(config) - return result?.val ?? null + if (result?.val) { + if (Object.keys(result.val).length > 0) return result.val + } + return null } async function setLocal(config: CacheConfig, val: T | null, updated_at: string): Promise { @@ -110,7 +113,10 @@ export async function getPracticeWordCacheLocalWithMeta(): Promise(PRACTICE_WORD_CACHE) } -export async function setPracticeWordCacheLocal(cache: PracticeWordCacheStored | null, updated_at?: string): Promise { +export async function setPracticeWordCacheLocal( + cache: PracticeWordCacheStored | null, + updated_at?: string +): Promise { await setLocal(PRACTICE_WORD_CACHE, cache, updated_at) } @@ -122,6 +128,9 @@ export async function getPracticeArticleCacheLocalWithMeta(): Promise(PRACTICE_ARTICLE_CACHE) } -export async function setPracticeArticleCacheLocal(cache: PracticeArticleCache | null, updated_at?: string): Promise { +export async function setPracticeArticleCacheLocal( + cache: PracticeArticleCache | null, + updated_at?: string +): Promise { await setLocal(PRACTICE_ARTICLE_CACHE, cache, updated_at) }