Skip to content

Commit 4af7106

Browse files
AWolf81Rokt33r
authored andcommitted
change theme path usage and remove relative path
1 parent bd52226 commit 4af7106

File tree

3 files changed

+4
-9
lines changed

3 files changed

+4
-9
lines changed

browser/components/MarkdownPreview.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -677,11 +677,7 @@ export default class MarkdownPreview extends React.Component {
677677
GetCodeThemeLink (name) {
678678
const theme = consts.THEMES.find(theme => theme.name === name)
679679

680-
if (theme) {
681-
return `${appPath}/${theme.path}`
682-
} else {
683-
return `${appPath}/node_modules/codemirror/theme/elegant.css`
684-
}
680+
return theme ? theme.path : `${appPath}/node_modules/codemirror/theme/elegant.css`
685681
}
686682

687683
rewriteIframe () {

browser/main/lib/ConfigManager.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ function validate (config) {
110110
}
111111

112112
function _save (config) {
113-
console.log(config)
114113
window.localStorage.setItem('config', JSON.stringify(config))
115114
}
116115

@@ -143,7 +142,7 @@ function get () {
143142
const theme = consts.THEMES.find(theme => theme.name === config.editor.theme)
144143

145144
if (theme) {
146-
editorTheme.setAttribute('href', `../${theme.path}`)
145+
editorTheme.setAttribute('href', theme.path)
147146
} else {
148147
config.editor.theme = 'default'
149148
}
@@ -191,7 +190,7 @@ function set (updates) {
191190
const newTheme = consts.THEMES.find(theme => theme.name === newConfig.editor.theme)
192191

193192
if (newTheme) {
194-
editorTheme.setAttribute('href', `../${newTheme.path}`)
193+
editorTheme.setAttribute('href', newTheme.path)
195194
}
196195

197196
ipcRenderer.send('config-renew', {

browser/main/modals/PreferencesModal/UiTab.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ class UiTab extends React.Component {
135135
const theme = consts.THEMES.find(theme => theme.name === newCodemirrorTheme)
136136

137137
if (theme) {
138-
checkHighLight.setAttribute('href', `../${theme.path}`)
138+
checkHighLight.setAttribute('href', theme.path)
139139
}
140140
}
141141

0 commit comments

Comments
 (0)