修复初始化异常的bug

master
yutent 2023-09-06 17:40:28 +08:00
parent 26a340ac56
commit d91bd574f0
3 changed files with 4 additions and 4 deletions

2
debian/control vendored
View File

@ -5,7 +5,7 @@ Architecture: all
Priority: optional
Maintainer: Yutent <yutent.io@gmail.com>
Installed-Size: {{size}}
Depends: python3-webengine-gtk3
Depends: python3-webengine-gtk3 (>=0.4.0)
Homepage: https://git.wkit.fun/appcat/hosts-switch/
Author: yutent
Description: 一个hosts绑定切换工具

View File

@ -48,7 +48,7 @@ class Application(Gtk.Application):
self.window.show_all()
def quit_all(self):
def quit_all(self, widget):
self.remove_window(self.window)

View File

@ -13,7 +13,7 @@ const LOCK_FILE = `${APP_CONFIG_DIR}/lock`
export function noop() {}
export function checkPermission() {
return native.fs.access('/etc/hosts', 'w')
return native.fs.access('/etc/hosts', 'a+')
}
export async function getHistory() {
@ -22,7 +22,7 @@ export async function getHistory() {
return JSON.parse(cache)
}
let cache = await native.fs.read('/etc/hosts').toString()
let cache = await native.fs.read('/etc/hosts')
let records = cache.split(/[\n\r]+/)
let list = []
let dict = {}