@@ -23,7 +23,7 @@ type CommitListResult = {
2323export default defineComponent ({
2424 components: {SvgIcon },
2525 data : () => {
26- const el = document .querySelector (' #diff-commit-select' );
26+ const el = document .querySelector (' #diff-commit-select' )! ;
2727 return {
2828 menuVisible: false ,
2929 isLoading: false ,
@@ -35,7 +35,7 @@ export default defineComponent({
3535 mergeBase: el .getAttribute (' data-merge-base' ),
3636 commits: [] as Array <Commit >,
3737 hoverActivated: false ,
38- lastReviewCommitSha: ' ' ,
38+ lastReviewCommitSha: ' ' as string | null ,
3939 uniqueIdMenu: generateElemId (' diff-commit-selector-menu-' ),
4040 uniqueIdShowAll: generateElemId (' diff-commit-selector-show-all-' ),
4141 };
@@ -165,7 +165,7 @@ export default defineComponent({
165165 },
166166 /** Called when user clicks on since last review */
167167 changesSinceLastReviewClick() {
168- window .location .assign (` ${this .issueLink }/files/${this .lastReviewCommitSha }..${this .commits .at (- 1 ).id }${this .queryParams } ` );
168+ window .location .assign (` ${this .issueLink }/files/${this .lastReviewCommitSha }..${this .commits .at (- 1 )! .id }${this .queryParams } ` );
169169 },
170170 /** Clicking on a single commit opens this specific commit */
171171 commitClicked(commitId : string , newWindow = false ) {
@@ -193,7 +193,7 @@ export default defineComponent({
193193 // find all selected commits and generate a link
194194 const firstSelected = this .commits .findIndex ((x ) => x .selected );
195195 const lastSelected = this .commits .findLastIndex ((x ) => x .selected );
196- let beforeCommitID: string ;
196+ let beforeCommitID: string | null = null ;
197197 if (firstSelected === 0 ) {
198198 beforeCommitID = this .mergeBase ;
199199 } else {
@@ -204,7 +204,7 @@ export default defineComponent({
204204 if (firstSelected === lastSelected ) {
205205 // if the start and end are the same, we show this single commit
206206 window .location .assign (` ${this .issueLink }/commits/${afterCommitID }${this .queryParams } ` );
207- } else if (beforeCommitID === this .mergeBase && afterCommitID === this .commits .at (- 1 ).id ) {
207+ } else if (beforeCommitID === this .mergeBase && afterCommitID === this .commits .at (- 1 )! .id ) {
208208 // if the first commit is selected and the last commit is selected, we show all commits
209209 window .location .assign (` ${this .issueLink }/files${this .queryParams } ` );
210210 } else {
0 commit comments