Fix install warning display and make it reactive

This commit is contained in:
DaneEveritt 2022-06-27 20:36:24 -04:00
parent 2dda151a49
commit bd278b2688
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
5 changed files with 39 additions and 24 deletions

View file

@ -13,6 +13,8 @@ export type ServerStatus = 'offline' | 'starting' | 'stopping' | 'running' | nul
interface ServerDataStore {
data?: Server;
inConflictState: Computed<ServerDataStore, boolean>;
isInstalling: Computed<ServerDataStore, boolean>;
isTransferring: Computed<ServerDataStore, boolean>;
permissions: string[];
getServer: Thunk<ServerDataStore, string, Record<string, unknown>, ServerStore, Promise<void>>;
@ -32,6 +34,10 @@ const server: ServerDataStore = {
return state.data.status !== null || state.data.isTransferring;
}),
isInstalling: computed((state) => {
return state.data?.status === 'installing' || state.data?.status === 'install_failed';
}),
getServer: thunk(async (actions, payload) => {
const [server, permissions] = await getServer(payload);