Skip to content

Commit

Permalink
fix publications/catalog, "Show Verified" -> "Show Sync Verified", re…
Browse files Browse the repository at this point in the history
…move console.logs
  • Loading branch information
adelikat committed Sep 2, 2024
1 parent ad64500 commit bdd3715
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions TASVideos/Pages/Submissions/Index.cshtml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ public SubmissionSearchRequest()
public string? GameId { get; set; }
public int? StartType { get; set; }

[Display(Name = "Show Sync Verified")]
public bool? ShowVerified { get; set; }

public ICollection<SubmissionStatus> Statuses { get; set; } = [];
Expand Down
12 changes: 6 additions & 6 deletions TASVideos/wwwroot/js/catalog.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function enableCataloging() {
const returnUrlPath = returnUrlPathAndQuery[0];
const returnUrlQuery = returnUrlPathAndQuery[1] ?? "";
const verifiedCheckbox = document.getElementById('Catalog_SyncVerified');
const origSyncVerified = verifiedCheckbox.checked;
const origSyncVerified = verifiedCheckbox?.checked;

systemModel.onchange = function () {
if (this.value) {
Expand All @@ -41,7 +41,6 @@ function enableCataloging() {
}

gameModel.onchange = function () {
console.log('gamemodel changed')
if (this.value) {
createVersionBtn?.removeAttribute('disabled');
createVersionBtn?.classList.remove('disabled');
Expand Down Expand Up @@ -73,10 +72,9 @@ function enableCataloging() {
}

versionModel.onchange = function() {
console.log('version changed')
setSyncVerifiedCheckbox();
}
console.log('versionModel', versionModel)

document.getElementById('create-version')?.addEventListener('click', function () {
document.location = `/Games/${gameModel.value}/Versions/Edit?SystemId=${systemModel.value}&returnUrl=${generateCurrentReturnUrl() }`;
});
Expand Down Expand Up @@ -109,6 +107,10 @@ function enableCataloging() {

function setSyncVerifiedCheckbox() {
const verifiedCheckbox = document.getElementById('Catalog_SyncVerified');
if (!verifiedCheckbox) {
return;
}

const emulatorInput = document.getElementById('Catalog_Emulator');

const canVerify = systemModel.value && frameRateModel.value && gameModel.value && versionModel.value && emulatorInput.value;
Expand All @@ -118,7 +120,5 @@ function enableCataloging() {
verifiedCheckbox.checked = origSyncVerified;
verifiedCheckbox.disabled = true;
}


}
}

0 comments on commit bdd3715

Please sign in to comment.