fix: theme page cannot be opened after the development environment is initialized (#833)

#### What type of PR is this?

/kind bug

#### What this PR does / why we need it:

修复在开发环境下首次初始化后,没有加载默认主题的情况下无法访问主题管理页面的问题。

#### Which issue(s) this PR fixes:

Fixes https://github.com/halo-dev/halo/issues/3187

#### Special notes for your reviewer:

测试方式:

1. 在开发环境使用全新的数据库初始化。
2. 检查是否能够正常的访问主题管理页面。

#### Does this PR introduce a user-facing change?

```release-note
None
```
pull/836/head
Ryan Wang 2023-02-01 10:48:10 +08:00 committed by GitHub
parent d51713ec27
commit 658a8ce4ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -19,7 +19,9 @@ export const useThemeStore = defineStore("theme", () => {
mute: true,
});
activatedTheme.value = data;
if (data) {
activatedTheme.value = data;
}
} catch (e) {
console.error("Failed to fetch active theme", e);
}