Skip to content

Commit

Permalink
More consistant look of Troubleshooting state
Browse files Browse the repository at this point in the history
  • Loading branch information
4Source committed Jun 25, 2024
1 parent 7e063be commit c34964d
Showing 1 changed file with 20 additions and 17 deletions.
37 changes: 20 additions & 17 deletions src/modals/PluginTroubleshootingModal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export class PluginTroubleshootingModal extends Modal {
repository = repoSections[1];
}
else {
username = value;
username = value;
}
updateRepo();
}));
Expand All @@ -65,7 +65,7 @@ export class PluginTroubleshootingModal extends Modal {
repository = repoSections[1];
}
else {
repository = value;
repository = value;
}
updateRepo();
}));
Expand All @@ -80,24 +80,27 @@ export class PluginTroubleshootingModal extends Modal {
.onClick(() => {
this.update();
}));

const releases = await fetchReleases(this.pluginInfo.repo);
hasReleases = releases !== undefined && (releases.length > 0);
new Setting(contentEl)
.setName('Test releases')
.setDesc(hasReleases ? '' : 'Could not find releases on GitHub. May this plugin did not have any.')
.addExtraButton(button => button
.setIcon(hasReleases ? ICON_ACCEPT : ICON_DENY)
.setTooltip(hasReleases ? '' : 'Try again?')
.setDisabled(hasReleases)
.onClick(() => {
this.update();
}));

let releases = undefined;

Check failure on line 84 in src/modals/PluginTroubleshootingModal.ts

View workflow job for this annotation

GitHub Actions / Build Plugin

Variable 'releases' implicitly has type 'any' in some locations where its type cannot be determined.
if (repositoryRegEx.test(this.pluginInfo.repo)) {
releases = await fetchReleases(this.pluginInfo.repo);
hasReleases = releases !== undefined && (releases.length > 0);
new Setting(contentEl)
.setName('Test releases')
.setDesc(hasReleases ? '' : 'Could not find releases on GitHub. May this plugin did not have any.')
.addExtraButton(button => button
.setIcon(hasReleases ? ICON_ACCEPT : ICON_DENY)
.setTooltip(hasReleases ? '' : 'Try again?')
.setDisabled(hasReleases)
.onClick(() => {
this.update();
}));
}

if (repositoryRegEx.test(this.pluginInfo.repo) || hasReleases) {
if (repositoryRegEx.test(this.pluginInfo.repo) && hasReleases) {
const last_release = releases ? releases[0] : undefined;
manifest =
await fetchManifest(undefined,undefined,last_release) ||
await fetchManifest(undefined, undefined, last_release) ||
await fetchManifest(this.pluginInfo.repo);
hasManifest = manifest !== undefined;
new Setting(contentEl)
Expand Down

0 comments on commit c34964d

Please sign in to comment.