Merge pull request #94 from Flow-Works/93-fix-battery-indicator

93-fix-battery-indicator
This commit is contained in:
ThinLiquid 2023-12-06 19:06:44 +00:00 committed by GitHub
commit de46189d0f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View file

@ -2,6 +2,7 @@ import icon from '../../assets/icons/web-browser.svg'
import { App } from '../../types' import { App } from '../../types'
import FlowWindow from '../../structures/FlowWindow' import FlowWindow from '../../structures/FlowWindow'
import { sanitize } from '../../utils'
export default class BrowserApp implements App { export default class BrowserApp implements App {
meta = { meta = {
@ -89,7 +90,7 @@ export default class BrowserApp implements App {
if (this === tabManager.activeTab) { if (this === tabManager.activeTab) {
(win.content.querySelector('.toggle') as HTMLElement).innerHTML = 'toggle_off' (win.content.querySelector('.toggle') as HTMLElement).innerHTML = 'toggle_off'
} }
this.iframe.src = win.content.querySelector('input')?.value as string this.iframe.src = sanitize(win.content.querySelector('input')?.value as string)
} else { } else {
if (this === tabManager.activeTab) { if (this === tabManager.activeTab) {
(win.content.querySelector('.toggle') as HTMLElement).innerHTML = 'toggle_on' (win.content.querySelector('.toggle') as HTMLElement).innerHTML = 'toggle_on'
@ -167,7 +168,7 @@ export default class BrowserApp implements App {
if (tabManager.activeTab.proxy) { if (tabManager.activeTab.proxy) {
tabManager.activeTab.iframe.src = `/service/${xor.encode((win.content.querySelector('.inp') as HTMLInputElement).value)}` tabManager.activeTab.iframe.src = `/service/${xor.encode((win.content.querySelector('.inp') as HTMLInputElement).value)}`
} else { } else {
tabManager.activeTab.iframe.src = (win.content.querySelector('.inp') as HTMLInputElement).value tabManager.activeTab.iframe.src = sanitize((win.content.querySelector('.inp') as HTMLInputElement).value)
} }
} }
}) })

View file

@ -53,7 +53,7 @@ class StatusBar {
iconHTML = 'battery_charging_50' iconHTML = 'battery_charging_50'
} else if (battery.level >= 0.3) { } else if (battery.level >= 0.3) {
iconHTML = 'battery_charging_30' iconHTML = 'battery_charging_30'
} else if (battery.level >= 0.2) { } else if (battery.level >= 0) {
iconHTML = 'battery_charging_20' iconHTML = 'battery_charging_20'
} }
} else { } else {