[release-2.0] fix: activated theme not loaded after initialization (#793)

This is an automated cherry-pick of #790

/assign ruibaby

```release-note
修复首次初始化之后,Console 没有加载已激活主题的问题。
```
pull/808/head
Halo Dev Bot 2022-12-22 13:38:29 +08:00 committed by GitHub
parent 8433dcbff1
commit c2f9b73a8d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -18,6 +18,7 @@ import type {
SinglePageRequest, SinglePageRequest,
Tag, Tag,
} from "@halo-dev/api-client"; } from "@halo-dev/api-client";
import { useThemeStore } from "@/stores/theme";
const router = useRouter(); const router = useRouter();
@ -98,6 +99,8 @@ const handleSubmit = async () => {
const systemStateStore = useSystemStatesStore(); const systemStateStore = useSystemStatesStore();
await systemStateStore.fetchSystemStates(); await systemStateStore.fetchSystemStates();
const themeStore = useThemeStore();
await themeStore.fetchActivatedTheme();
router.push({ name: "Dashboard" }); router.push({ name: "Dashboard" });
} catch (error) { } catch (error) {