refactor: replace 'let' with 'const' for better variable scoping and immutability
This commit is contained in:
@@ -379,7 +379,7 @@ export const DnsViewer = forwardRef<DialogRef>((props, ref) => {
|
||||
const formatHosts = (hosts: any): string => {
|
||||
if (!hosts || typeof hosts !== "object") return "";
|
||||
|
||||
let result: string[] = [];
|
||||
const result: string[] = [];
|
||||
|
||||
Object.entries(hosts).forEach(([domain, value]) => {
|
||||
if (Array.isArray(value)) {
|
||||
|
||||
@@ -53,7 +53,7 @@ export const TunViewer = forwardRef<DialogRef>((props, ref) => {
|
||||
|
||||
const onSave = useLockFn(async () => {
|
||||
try {
|
||||
let tun = {
|
||||
const tun = {
|
||||
stack: values.stack,
|
||||
device:
|
||||
values.device === ""
|
||||
@@ -97,7 +97,7 @@ export const TunViewer = forwardRef<DialogRef>((props, ref) => {
|
||||
variant="outlined"
|
||||
size="small"
|
||||
onClick={async () => {
|
||||
let tun = {
|
||||
const tun = {
|
||||
stack: "gvisor",
|
||||
device: OS === "macos" ? "utun1024" : "Mihomo",
|
||||
"auto-route": true,
|
||||
|
||||
Reference in New Issue
Block a user