Fix install warning display and make it reactive
This commit is contained in:
parent
2dda151a49
commit
bd278b2688
5 changed files with 39 additions and 24 deletions
|
@ -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);
|
||||
|
||||
|
|
Reference in a new issue