diff --git a/.vscode/extension.json b/.vscode/extension.json index 685ef5aa..376e1639 100644 --- a/.vscode/extension.json +++ b/.vscode/extension.json @@ -1,3 +1,7 @@ { - "recommendations": ["biomejs.biome", "stylelint.vscode-stylelint", "wayou.vscode-todo-highlight"] + "recommendations": [ + "biomejs.biome", + "stylelint.vscode-stylelint", + "wayou.vscode-todo-highlight" + ] } diff --git a/package.json b/package.json index 2380f442..6bffbb39 100644 --- a/package.json +++ b/package.json @@ -68,7 +68,7 @@ "@tiptap/extension-youtube": "^2.5.8", "@types/cookie": "^0.6.0", "@types/cookie-signature": "^1.1.2", - "@types/node": "^20.14.13", + "@types/node": "^20.14.14", "@types/throttle-debounce": "^5.0.2", "@urql/core": "^5.0.5", "bootstrap": "^5.3.3", @@ -98,8 +98,8 @@ "stylelint-config-recommended": "^14.0.1", "stylelint-config-standard-scss": "^13.1.0", "stylelint-order": "^6.0.4", - "stylelint-scss": "^6.4.1", - "swiper": "^11.1.8", + "stylelint-scss": "^6.5.0", + "swiper": "^11.1.9", "throttle-debounce": "^5.0.2", "tslib": "^2.6.3", "typescript": "^5.5.4", diff --git a/src/context/topics.tsx b/src/context/topics.tsx index a577370b..17ee753b 100644 --- a/src/context/topics.tsx +++ b/src/context/topics.tsx @@ -157,10 +157,13 @@ export const TopicsProvider = (props: { children: JSX.Element }) => { ) setTopicEntities((prevTopicEntities) => { - return { + const ttt = { ...prevTopicEntities, ...newTopicEntities } + + if (db()) saveTopicsToIndexedDB(db() as IDBDatabase, Object.values(ttt) as Topic[]) + return ttt }) } const [db, setDb] = createSignal() @@ -179,7 +182,6 @@ export const TopicsProvider = (props: { children: JSX.Element }) => { const topicsLoader = loadTopics() const ttt = await topicsLoader() ttt && addTopics(ttt) - if (db()) await saveTopicsToIndexedDB(db() as IDBDatabase, ttt as Topic[]) return ttt || [] } diff --git a/src/routes/topic/[slug]/[...tab].tsx b/src/routes/topic/[slug]/[...tab].tsx index c85d0f15..fa9374eb 100644 --- a/src/routes/topic/[slug]/[...tab].tsx +++ b/src/routes/topic/[slug]/[...tab].tsx @@ -58,7 +58,7 @@ export default function TopicPage(props: RouteSectionProps) { async () => props.data.articles || (await fetchTopicShouts(props.params.slug)) || [] ) - const title = createMemo(() => `${t('Discours')} :: ${topic()?.title || ''}`) + const title = createMemo(() => `${t('Discours')}${ topic()?.title ? (` :: ${topic()?.title}`) : '' }`) createEffect(() => { if (topic() && window) {