Skip to content

Commit

Permalink
fix: make status nonnull
Browse files Browse the repository at this point in the history
  • Loading branch information
ci010 committed Jul 7, 2019
1 parent b3e8ff7 commit 71b4a18
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/universal/store/modules/profile.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export declare namespace ProfileModule {
port: number;

// cache
status?: Server.StatusFrame;
status: Server.StatusFrame;
}

interface Profile extends ProfileBase {
Expand Down Expand Up @@ -159,6 +159,8 @@ export declare namespace ProfileModule {
diagnoseProfile(context: C): Promise<Problem[]>;
fixProfile(context: C, problems: Problem[]): Promise<void>

pingServer(context: C, payload: { host: string, port: number, protocol: number }): Promise<Server.StatusFrame>

importMap(context: C, path: string): Promise<void>
deleteMap(context: C, name: string): Promise<void>
exportMap(context: C, payload: { name: string, destination: string, zip?: boolean }): Promise<void>
Expand Down
4 changes: 3 additions & 1 deletion src/universal/store/modules/profile.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import Vue from 'vue';
import { getExpectVersion } from 'universal/utils/versions';
import { fitin } from 'universal/utils/object';

import { UNKNOWN_STATUS } from 'universal/utils/server-status';

/**
* @type {import('./profile').TemplateFunction}
*/
export function createTemplate(id, java, mcversion, type = 'modpack') {
console.log(`Template from ${type}`);
/**
* @type {import('./profile').ProfileModule.ProfileBase}
*/
Expand Down Expand Up @@ -72,6 +73,7 @@ export function createTemplate(id, java, mcversion, type = 'modpack') {
port: 0,
...base,
type: 'server',
status: UNKNOWN_STATUS,
};
return server;
}
Expand Down

0 comments on commit 71b4a18

Please sign in to comment.