Skip to content

Commit

Permalink
Add typing for downloadObject
Browse files Browse the repository at this point in the history
Changing from any type to a proper type reveals that the object can be
null in couple of places - non-null assertions are used for these to
avoid having to deal with these right now.
  • Loading branch information
anttimaki committed Apr 15, 2024
1 parent 30b0f19 commit 52ed2bc
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/components/views/DownloadModModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,14 @@ import { Progress } from '../all';
import Game from '../../model/game/Game';
import ConflictManagementProvider from '../../providers/generic/installing/ConflictManagementProvider';
interface DownloadProgress {
assignId: number;
initialMods: string[];
modName: string;
progress: number;
failed: boolean;
}
let assignId = 0;
@Component({
Expand All @@ -124,12 +132,12 @@ let assignId = 0;
export default class DownloadModModal extends Vue {
versionNumbers: string[] = [];
downloadObject: any | null = null;
downloadObject: DownloadProgress | null = null;
downloadingMod: boolean = false;
selectedVersion: string | null = null;
currentVersion: string | null = null;
static allVersions: [number, any][] = [];
static allVersions: [number, DownloadProgress][] = [];
get activeGame(): Game {
return this.$store.state.activeGame;
Expand Down Expand Up @@ -281,7 +289,7 @@ let assignId = 0;
assignId: currentAssignId,
failed: false,
}
if (this.downloadObject.assignId === currentAssignId) {
if (this.downloadObject!.assignId === currentAssignId) {
this.downloadObject = Object.assign({}, obj);
}
this.$set(DownloadModModal.allVersions, assignIndex, [currentAssignId, obj]);
Expand Down Expand Up @@ -322,7 +330,7 @@ let assignId = 0;
assignId: currentAssignId,
failed: false,
}
if (this.downloadObject.assignId === currentAssignId) {
if (this.downloadObject!.assignId === currentAssignId) {
this.downloadObject = Object.assign({}, obj);
}
this.$set(DownloadModModal.allVersions, assignIndex, [currentAssignId, obj]);
Expand Down

0 comments on commit 52ed2bc

Please sign in to comment.