Fixed backgrounds repeating and entry in settings
This commit is contained in:
parent
42db1fd15e
commit
aa6807a0ff
3 changed files with 7 additions and 8 deletions
|
|
@ -100,7 +100,7 @@ const BootLoader: Process = {
|
|||
const dataString = Buffer.from(data).toString()
|
||||
const config = parse(dataString)
|
||||
document.body.style.backgroundImage = "url(" + config.BACKGROUND.toString() + ")"})
|
||||
|
||||
document.body.style.backgroundSize = "cover"
|
||||
await statusBar.element.appendTo(document.body)
|
||||
await launcher.element.appendTo(document.body)
|
||||
await wm.windowArea.appendTo(document.body)
|
||||
|
|
|
|||
|
|
@ -377,7 +377,8 @@ export const defaultFS: { root: Directory } = {
|
|||
'SERVER=http://localhost:3000/',
|
||||
'24_HOUR=false',
|
||||
'THEME=Mocha',
|
||||
'THEME_PRIMARY=blue'
|
||||
'THEME_PRIMARY=blue',
|
||||
'BACKGROUND='
|
||||
].join('\n'))
|
||||
},
|
||||
hostname: {
|
||||
|
|
@ -449,6 +450,10 @@ class VirtualFS {
|
|||
config.THEME_PRIMARY = 'blue'
|
||||
await this.writeFile('/etc/flow', stringify(config))
|
||||
}
|
||||
if (config.BACKGROUND == null) {
|
||||
config.BACKGROUND = ''
|
||||
await this.writeFile('/etc/flow', stringify(config))
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -39,12 +39,6 @@ const Settings: Process = {
|
|||
} else if (item === 'THEME') {
|
||||
input = Dropdown.new((await fs.readdir('/etc/themes')).map((theme: string) => theme.replace('.theme', '')))
|
||||
}
|
||||
if (item === 'BACKGROUND') {
|
||||
const { background } = JSON.parse(Buffer.from(await fs.readFile(`/etc/flow/${config.BACKGROUND as string}.BACKGROUND`)).toString())
|
||||
document.cookie = "background=" + background + "; expires=Thu, 18 Dec 9999 12:00:00 UTC; path=/";
|
||||
} else if (item === 'THEME') {
|
||||
input = Dropdown.new((await fs.readdir('/etc/themes')).map((theme: string) => theme.replace('.theme', '')))
|
||||
}
|
||||
|
||||
if (item === 'THEME_PRIMARY' || item === 'THEME') {
|
||||
(input.elm as HTMLSelectElement).value = config[item]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue