Skip to content

Commit

Permalink
fix: made code follow ts-standard
Browse files Browse the repository at this point in the history
  • Loading branch information
ThinLiquid committed Jan 22, 2024
1 parent 48294da commit cf8f1b8
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
7 changes: 2 additions & 5 deletions src/system/Desktop.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import HTML from '../HTML'
import { AppClosedEvent, AppOpenedEvent, Directory, FileSystemObject, Process } from '../types'
import { AppClosedEvent, AppOpenedEvent, Process } from '../types'
import { getTime } from '../utils'
import { defaultFS } from './VirtualFS'
import nullIcon from '../assets/icons/application-default-icon.svg'
import { parse } from 'js-ini'
import { v4 as uuid } from 'uuid'

const BootLoader: Process = {
config: {
Expand All @@ -17,7 +14,7 @@ const BootLoader: Process = {
const splashElement = splashScreen.getElement()
splashElement.appendTo(document.body)

const fs = process.fs
const { fs } = process
const wm = await process.loadLibrary('lib/WindowManager')
const launcher = await process.loadLibrary('lib/Launcher')

Expand Down
8 changes: 4 additions & 4 deletions src/system/apps/Browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const BrowserApp: Process = {
iframe: HTMLIFrameElement = document.createElement('iframe')

constructor (url: string) {
this.iframe.src = `/service/${xor.encode(url) as string}`
this.iframe.src = `/service/${xor.encode(url)}`
this.iframe.style.display = 'none'

this.header.innerHTML = `
Expand All @@ -91,13 +91,13 @@ const BrowserApp: Process = {
(win.content.querySelector('.toggle') as HTMLElement).innerHTML = 'toggle_off'
}
(this.header.querySelector('.title') as HTMLElement).innerText = 'Tab'
this.iframe.src = (win.content.querySelector('input')?.value as string)
this.iframe.src = (win.content.querySelector('input')?.value)
return
}
if (this === tabManager.activeTab) {
(win.content.querySelector('.toggle') as HTMLElement).innerHTML = 'toggle_on'
}
this.iframe.src = `/service/${xor.encode(win.content.querySelector('input')?.value ?? '') as string}`
this.iframe.src = `/service/${xor.encode(win.content.querySelector('input')?.value ?? '')}`
}
}

Expand Down Expand Up @@ -167,7 +167,7 @@ const BrowserApp: Process = {

win.content.querySelector('.inp')?.addEventListener('keydown', (event: KeyboardEvent) => {
if (event.key === 'Enter') {
tabManager.activeTab.iframe.src = tabManager.activeTab.proxy ? `/service/${xor.encode((win.content.querySelector('.inp') as HTMLInputElement).value) as string}` : (win.content.querySelector('.inp') as HTMLInputElement).value
tabManager.activeTab.iframe.src = tabManager.activeTab.proxy ? `/service/${xor.encode((win.content.querySelector('.inp') as HTMLInputElement).value)}` : (win.content.querySelector('.inp') as HTMLInputElement).value
}
});

Expand Down
19 changes: 11 additions & 8 deletions src/system/apps/Settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,20 @@ const Settings: Process = {
})
.appendMany(
input,
Button.new().text('Save').on('click', async () => {
Button.new().text('Save').on('click', () => {
config[item] = input.getValue()
process.kernel.setConfig(config)
await fs.writeFile('/etc/flow', stringify(config))
document.dispatchEvent(
new CustomEvent('config_update', {
detail: {
config
}
fs.writeFile('/etc/flow', stringify(config))
.then(() => {
document.dispatchEvent(
new CustomEvent('config_update', {
detail: {
config
}
})
)
})
)
.catch(e => console.error(e))
})
)
)
Expand Down

0 comments on commit cf8f1b8

Please sign in to comment.