Skip to content

Commit

Permalink
Merge pull request #2561 from posit-dev/dotnomad/content-check
Browse files Browse the repository at this point in the history
Only show the view content button with a valid link
  • Loading branch information
dotNomad authored Jan 28, 2025
2 parents 00278b7 + 645a089 commit 1744de3
Showing 1 changed file with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,7 @@
/>
</div>
</template>
<div
v-if="!isPreContentRecord(home.selectedContentRecord)"
class="last-deployment-details"
>
<div v-if="showContentButton" class="last-deployment-details">
<vscode-button
appearance="secondary"
@click="viewContent"
Expand Down Expand Up @@ -552,6 +549,16 @@ const onAssociateDeployment = () => {
});
};

const showContentButton = computed(() => {
const record = home.selectedContentRecord;
if (!record) {
return;
}
return (
record?.dashboardUrl || (!isPreContentRecord(record) && record.logsUrl)
);
});

const viewContent = () => {
const record = home.selectedContentRecord;
if (!record) {
Expand Down

0 comments on commit 1744de3

Please sign in to comment.