Skip to content

Commit 8a3bf95

Browse files
committed
fix: defer state mutation in rowProvider to avoid undefined SwiftUI behavior, add Vietnamese translations
1 parent a01f673 commit 8a3bf95

2 files changed

Lines changed: 100 additions & 7 deletions

File tree

TablePro/Resources/Localizable.xcstrings

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10516,6 +10516,16 @@
1051610516
}
1051710517
}
1051810518
},
10519+
"Editable Hex" : {
10520+
"localizations" : {
10521+
"vi" : {
10522+
"stringUnit" : {
10523+
"state" : "translated",
10524+
"value" : "Hex có thể chỉnh sửa"
10525+
}
10526+
}
10527+
}
10528+
},
1051910529
"Editing" : {
1052010530
"localizations" : {
1052110531
"tr" : {
@@ -15254,6 +15264,16 @@
1525415264
}
1525515265
}
1525615266
},
15267+
"Installing…" : {
15268+
"localizations" : {
15269+
"vi" : {
15270+
"stringUnit" : {
15271+
"state" : "translated",
15272+
"value" : "Đang cài đặt…"
15273+
}
15274+
}
15275+
}
15276+
},
1525715277
"Interface" : {
1525815278
"localizations" : {
1525915279
"tr" : {
@@ -15963,6 +15983,16 @@
1596315983
}
1596415984
}
1596515985
},
15986+
"Keys" : {
15987+
"localizations" : {
15988+
"vi" : {
15989+
"stringUnit" : {
15990+
"state" : "translated",
15991+
"value" : "Khóa"
15992+
}
15993+
}
15994+
}
15995+
},
1596615996
"Keys are provided by the SSH agent (e.g. 1Password, ssh-agent)." : {
1596715997
"localizations" : {
1596815998
"tr" : {
@@ -16823,6 +16853,16 @@
1682316853
}
1682416854
}
1682516855
},
16856+
"Loading keys…" : {
16857+
"localizations" : {
16858+
"vi" : {
16859+
"stringUnit" : {
16860+
"state" : "translated",
16861+
"value" : "Đang tải khóa…"
16862+
}
16863+
}
16864+
}
16865+
},
1682616866
"Loading plugins..." : {
1682716867
"extractionState" : "stale",
1682816868
"localizations" : {
@@ -18744,6 +18784,16 @@
1874418784
}
1874518785
}
1874618786
},
18787+
"No keys" : {
18788+
"localizations" : {
18789+
"vi" : {
18790+
"stringUnit" : {
18791+
"state" : "translated",
18792+
"value" : "Không có khóa"
18793+
}
18794+
}
18795+
}
18796+
},
1874718797
"No limit" : {
1874818798
"localizations" : {
1874918799
"tr" : {
@@ -19718,6 +19768,16 @@
1971819768
}
1971919769
}
1972019770
},
19771+
"Not Installed" : {
19772+
"localizations" : {
19773+
"vi" : {
19774+
"stringUnit" : {
19775+
"state" : "translated",
19776+
"value" : "Chưa cài đặt"
19777+
}
19778+
}
19779+
}
19780+
},
1972119781
"NOT NULL" : {
1972219782
"extractionState" : "stale",
1972319783
"localizations" : {
@@ -21039,6 +21099,17 @@
2103921099
}
2104021100
}
2104121101
},
21102+
"Plugin" : {
21103+
"comment" : "Plugin is a technical term",
21104+
"localizations" : {
21105+
"vi" : {
21106+
"stringUnit" : {
21107+
"state" : "translated",
21108+
"value" : "Plugin"
21109+
}
21110+
}
21111+
}
21112+
},
2104221113
"Plugin '%@' has an invalid descriptor: %@" : {
2104321114
"localizations" : {
2104421115
"en" : {
@@ -26389,6 +26460,16 @@
2638926460
}
2639026461
}
2639126462
},
26463+
"Showing first 50,000 keys" : {
26464+
"localizations" : {
26465+
"vi" : {
26466+
"stringUnit" : {
26467+
"state" : "translated",
26468+
"value" : "Hiển thị 50.000 khóa đầu tiên"
26469+
}
26470+
}
26471+
}
26472+
},
2639226473
"Sidebar" : {
2639326474
"localizations" : {
2639426475
"tr" : {
@@ -30542,6 +30623,16 @@
3054230623
}
3054330624
}
3054430625
},
30626+
"Truncated — read only" : {
30627+
"localizations" : {
30628+
"vi" : {
30629+
"stringUnit" : {
30630+
"state" : "translated",
30631+
"value" : "Đã cắt bớt — chỉ đọc"
30632+
}
30633+
}
30634+
}
30635+
},
3054530636
"Trust" : {
3054630637
"localizations" : {
3054730638
"tr" : {

TablePro/Views/Main/Child/MainEditorContentView.swift

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ struct MainEditorContentView: View {
345345

346346
private func rowProvider(for tab: QueryTab) -> InMemoryRowProvider {
347347
if tab.rowBuffer.isEvicted {
348-
tabProviderCache.removeValue(forKey: tab.id)
348+
DispatchQueue.main.async { tabProviderCache.removeValue(forKey: tab.id) }
349349
return makeRowProvider(for: tab)
350350
}
351351
if let entry = tabProviderCache[tab.id],
@@ -355,12 +355,14 @@ struct MainEditorContentView: View {
355355
return entry.provider
356356
}
357357
let provider = makeRowProvider(for: tab)
358-
tabProviderCache[tab.id] = RowProviderCacheEntry(
359-
provider: provider,
360-
resultVersion: tab.resultVersion,
361-
metadataVersion: tab.metadataVersion,
362-
sortState: tab.sortState
363-
)
358+
DispatchQueue.main.async {
359+
tabProviderCache[tab.id] = RowProviderCacheEntry(
360+
provider: provider,
361+
resultVersion: tab.resultVersion,
362+
metadataVersion: tab.metadataVersion,
363+
sortState: tab.sortState
364+
)
365+
}
364366
return provider
365367
}
366368

0 commit comments

Comments
 (0)