mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-22 00:13:12 +09:00
Use filtered subscriptions to save data
This commit is contained in:
1 parent
ea144863f9
commit
38d5fdfdba
4 files changed
+67
-16
No files matched your search
@@ -37,6 +37,13 @@ export default function MinimapPage() {
|
||||
loadSurfaceForceData();
|
||||
}, []);
|
||||
|
||||
// Keep subscription filters in sync with selection even on the legacy page
|
||||
useEffect(() => {
|
||||
const plugin = control.plugins.get("minimap") as import("./index").WebPlugin;
|
||||
if (!plugin) { return; }
|
||||
plugin.setInstanceSurfaceFilter(selectedInstance, selectedSurface || null);
|
||||
}, [control, selectedInstance, selectedSurface]);
|
||||
|
||||
const loadSurfaceForceData = async () => {
|
||||
const response = await fetch(`${window.location.origin}/api/minimap/surfaces`);
|
||||
const data = await response.json();
|
||||
|
||||
Reference in new issue
Block a user