Skip to content
This repository has been archived by the owner on Mar 23, 2023. It is now read-only.

Commit

Permalink
feat: expose profiles themes to plugins (#1795)
Browse files Browse the repository at this point in the history
  • Loading branch information
dated authored Mar 9, 2020
1 parent d04ac63 commit fa930f7
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/renderer/store/modules/profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,20 @@ export default new BaseModule(ProfileModel, {
},

public: (state, _, __, rootGetters) => (all = false) => {
const minimiseProfile = (profile) => ({
const isDarkTheme = theme => {
if (['light', 'dark'].includes(theme)) {
return theme === 'dark'
}
return rootGetters['plugin/themes'][theme].darkMode
}

const minimiseProfile = profile => ({
avatar: profile.avatar,
currency: profile.currency,
theme: {
name: profile.theme,
isDark: isDarkTheme(profile.theme)
},
language: profile.language,
name: profile.name,
network: rootGetters['network/byId'](profile.networkId),
Expand Down

0 comments on commit fa930f7

Please sign in to comment.