mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
ui: fix macos icon
This commit is contained in:
1 file changed
+2
-1
@@ -157,9 +157,10 @@ env.addGlobal('set', (obj, key, val) => {
|
|||||||
env.addGlobal('findSubModule', (prefix) => Object.keys(global.Hydro.ui.template).filter((n) => n.startsWith(prefix)));
|
env.addGlobal('findSubModule', (prefix) => Object.keys(global.Hydro.ui.template).filter((n) => n.startsWith(prefix)));
|
||||||
env.addGlobal('templateExists', (name) => !!global.Hydro.ui.template[name]);
|
env.addGlobal('templateExists', (name) => !!global.Hydro.ui.template[name]);
|
||||||
|
|
||||||
|
const platformIconMap = { 'mac os': 'mac' };
|
||||||
const supportedPlatformIcons = ['android', 'chromeos', 'ios', 'linux', 'mac', 'mobile', 'windows'];
|
const supportedPlatformIcons = ['android', 'chromeos', 'ios', 'linux', 'mac', 'mobile', 'windows'];
|
||||||
env.addGlobal('platformIcon', (platform) => {
|
env.addGlobal('platformIcon', (platform) => {
|
||||||
const key = platform?.toLowerCase();
|
const key = platformIconMap[platform?.toLowerCase()] || platform?.toLowerCase();
|
||||||
if (supportedPlatformIcons.includes(key)) return key;
|
if (supportedPlatformIcons.includes(key)) return key;
|
||||||
return 'unknown';
|
return 'unknown';
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in new issue
Block a user