mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-18 15:33:12 +09:00
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:
1 parent
928e03ce02
commit
2e1710d3a9
18 files changed
+233
-112
No files matched your search
@@ -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() {
|
||||
|
||||
Reference in new issue
Block a user