code refactor
This commit is contained in:
+1
-20
@@ -830,30 +830,11 @@ const allCategoryIcons = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const deviceIcons = {
|
|
||||||
mobile: {
|
|
||||||
f7Icon: 'device_phone_portrait'
|
|
||||||
},
|
|
||||||
tablet: {
|
|
||||||
f7Icon: 'device_tablet_portrait'
|
|
||||||
},
|
|
||||||
wearable: {
|
|
||||||
f7Icon: 'device_phone_portrait'
|
|
||||||
},
|
|
||||||
desktop: {
|
|
||||||
f7Icon: 'device_desktop'
|
|
||||||
},
|
|
||||||
tv: {
|
|
||||||
f7Icon: 'tv'
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
allAccountIcons: allAccountIcons,
|
allAccountIcons: allAccountIcons,
|
||||||
defaultAccountIconId: defaultAccountIconId,
|
defaultAccountIconId: defaultAccountIconId,
|
||||||
defaultAccountIcon: allAccountIcons[defaultAccountIconId],
|
defaultAccountIcon: allAccountIcons[defaultAccountIconId],
|
||||||
allCategoryIcons: allCategoryIcons,
|
allCategoryIcons: allCategoryIcons,
|
||||||
defaultCategoryIconId: defaultCategoryIconId,
|
defaultCategoryIconId: defaultCategoryIconId,
|
||||||
defaultCategoryIcon: allCategoryIcons[defaultCategoryIconId],
|
defaultCategoryIcon: allCategoryIcons[defaultCategoryIconId]
|
||||||
deviceIcons: deviceIcons,
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -196,19 +196,19 @@ export default {
|
|||||||
const ua = parseUserAgent(token.userAgent);
|
const ua = parseUserAgent(token.userAgent);
|
||||||
|
|
||||||
if (!ua || !ua.device) {
|
if (!ua || !ua.device) {
|
||||||
return iconConstants.deviceIcons.desktop.f7Icon;
|
return 'device_desktop';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ua.device.type === 'mobile') {
|
if (ua.device.type === 'mobile') {
|
||||||
return iconConstants.deviceIcons.mobile.f7Icon;
|
return 'device_phone_portrait';
|
||||||
} else if (ua.device.type === 'wearable') {
|
} else if (ua.device.type === 'wearable') {
|
||||||
return iconConstants.deviceIcons.wearable.f7Icon;
|
return 'device_phone_portrait';
|
||||||
} else if (ua.device.type === 'tablet') {
|
} else if (ua.device.type === 'tablet') {
|
||||||
return iconConstants.deviceIcons.tablet.f7Icon;
|
return 'device_tablet_portrait';
|
||||||
} else if (ua.device.type === 'smarttv') {
|
} else if (ua.device.type === 'smarttv') {
|
||||||
return iconConstants.deviceIcons.tv.f7Icon;
|
return 'tv';
|
||||||
} else {
|
} else {
|
||||||
return iconConstants.deviceIcons.desktop.f7Icon;
|
return 'device_desktop';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
getTokenDomId(tokenId) {
|
getTokenDomId(tokenId) {
|
||||||
|
|||||||
Reference in New Issue
Block a user