Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,7 @@ conf.yaml

# Old Go files
translate.*.toml
index.php
index.php

# Pnpm files
pnpm-*
3 changes: 2 additions & 1 deletion src-tauri/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,8 @@ pub fn run() {
}
})
.on_tray_icon_event(|tray, event| {
if let tauri::tray::TrayIconEvent::Click { .. } = event {
use tauri::tray::MouseButton;
if let tauri::tray::TrayIconEvent::Click { button: MouseButton::Left, .. } = event {
let app = tray.app_handle();
if let Some(window) = app.get_webview_window("main") {
let _ = window.show();
Expand Down
4 changes: 4 additions & 0 deletions src-tauri/src/services.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ pub async fn client_fetch_hosts(url: &str) -> Result<(), String> {
let newline = hosts::newline_char();
let mut result = clean_hosts;

result.push_str("# fetch-github-hosts begin");
result.push_str(newline);
for line in fetch_hosts.lines() {
let trimmed = line.trim();
if trimmed.is_empty() || trimmed.starts_with('#') {
Expand All @@ -91,6 +93,8 @@ pub async fn client_fetch_hosts(url: &str) -> Result<(), String> {
result.push_str(line);
result.push_str(newline);
}
result.push_str("# fetch-github-hosts end");
result.push_str(newline);

hosts::write_hosts(&result)?;

Expand Down