Show the same page for missing, deleted and unloadable resources

Every view page handled a resource that can't be shown its own way, and
users without the subscribe permission were left on a spinner forever.

Adds useResourceState and a ResourceState component, used by the host,
instance, mod pack, icon reference, user, role and plugin pages and
exported for plugin pages. The single item hooks now also return the
subscription error.

Resolves #1165
This commit is contained in:
Danielv123 authored and GitHub committed 2026-11-01 17:40:22 +01:00
1 parent 928e03ce02
commit 2e1710d3a9
18 files changed
+233 -112

No files matched your search

+2 -2
View File
@@ -4,8 +4,8 @@ import { Config, InstanceConfigGetRequest } from "@clusterio/lib";
import ControlContext from "../components/ControlContext";
export function useInstance(id?: number) {
const [instances, synced] = useInstances();
return [id !== undefined ? instances.get(id) : undefined, synced] as const;
const [instances, synced, error] = useInstances();
return [id !== undefined ? instances.get(id) : undefined, synced, error] as const;
}
export function useInstances() {