Skip to content

Commit 2283eb1

Browse files
committed
Add AppConfigId and filter Errors and isValie
1 parent 1525254 commit 2283eb1

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

generator.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ class generatorViewModel {
4242
//this.Meta_ConfigReleaseState = ko.observable("NotSpecified");
4343
//this.Meta_NoCommercialUsage = ko.observable("False");
4444
this.Meta_EndpointURIFormat = ko.observable(`steam://connect/{ip}:{GenericModule.App.Ports.$SteamQueryPort}`);
45+
this.Meta_AppConfigId = function guid() {
46+
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
47+
var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
48+
return v.toString(16);
49+
});
50+
}
4551

4652
this._SupportsWindows = ko.observable(true);
4753
this._SupportsLinux = ko.observable(true);
@@ -352,9 +358,9 @@ class generatorViewModel {
352358
self.__AddEditStage(new updateStageViewModel(self));
353359
$("#addEditStageModal").modal('show');
354360
};
355-
this.Errors = ko.validation.group(self);
356-
this.isValid = ko.computed(function () {
357-
return self.Errors().length == 0;
361+
this.__Errors = ko.validation.group(self);
362+
this.__isValid = ko.computed(function () {
363+
return self.__Errors().length == 0;
358364
});
359365

360366
this.__DoAddStage = function () {
@@ -533,8 +539,8 @@ class generatorViewModel {
533539

534540
this.__ValidateConfig = function () {
535541
autoSave();
536-
if (!self.isValid()) {
537-
self.Errors.showAllMessages();
542+
if (!self.__isValid()) {
543+
self.__Errors.showAllMessages();
538544
return;
539545
}
540546
self.__ValidationResults.removeAll();

0 commit comments

Comments
 (0)