release: v0.2.1 — bug修复、代码去重、功能增强、覆盖率88.57%
This commit is contained in:
+2
-5
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* MetonaToast Themes — 主题管理
|
||||
* @module themes
|
||||
* @version 0.2.0
|
||||
* @version 0.2.1
|
||||
*/
|
||||
|
||||
import { THEMES } from './constants.js';
|
||||
@@ -30,13 +30,10 @@ export const getTheme = (theme: string): string => {
|
||||
};
|
||||
|
||||
/**
|
||||
* 解析主题
|
||||
* 解析主题 — 'auto' 始终按系统主题检测,不依赖当前手动选择的主题
|
||||
*/
|
||||
export const resolveTheme = (theme: string): string => {
|
||||
if (theme === 'auto') {
|
||||
if (currentTheme && currentTheme !== 'auto') {
|
||||
return currentTheme;
|
||||
}
|
||||
return getSystemTheme();
|
||||
}
|
||||
return theme;
|
||||
|
||||
Reference in New Issue
Block a user