Skip to content

Commit 22c63e6

Browse files
authored
Cleaning up.
2 parents f33d771 + 3520358 commit 22c63e6

7 files changed

Lines changed: 17 additions & 14 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"url": "git+https://github.com/opencor/webapp.git"
2424
},
2525
"type": "module",
26-
"version": "0.20260220.0",
26+
"version": "0.20260220.1",
2727
"scripts": {
2828
"archive:web": "bun src/renderer/scripts/archive.web.js",
2929
"build": "electron-vite build",

src/renderer/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
},
4040
"./style.css": "./dist/opencor.css"
4141
},
42-
"version": "0.20260220.0",
42+
"version": "0.20260220.1",
4343
"scripts": {
4444
"build": "vite build && bun scripts/generate.version.js",
4545
"build:lib": "vite build --config vite.lib.config.ts && cp index.d.ts dist/index.d.ts",

src/renderer/src/common/locCommon.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,6 @@ export const simulationData = (instanceTask: locApi.SedInstanceTask, info: ISimu
357357
case ESimulationDataInfoType.ALGEBRAIC:
358358
return instanceTask.algebraicVariable(info.index);
359359
default:
360-
return [];
360+
return new Float64Array();
361361
}
362362
};

src/renderer/src/components/ContentsComponent.vue

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,17 +120,20 @@ const selectFile = (filePath: string): void => {
120120
121121
const selectNextFile = (): void => {
122122
const fileTabIndex = fileTabs.value.findIndex((fileTab) => fileTab.file.path() === activeFile.value);
123+
const fileTabName = fileTabs.value[(fileTabIndex + 1) % fileTabs.value.length]?.file.path() || '';
123124
124-
if (fileTabIndex !== -1) {
125-
selectFile(fileTabs.value[(fileTabIndex + 1) % fileTabs.value.length].file.path());
125+
if (fileTabName !== '') {
126+
selectFile(fileTabName);
126127
}
127128
};
128129
129130
const selectPreviousFile = (): void => {
130131
const fileTabIndex = fileTabs.value.findIndex((fileTab) => fileTab.file.path() === activeFile.value);
132+
const fileTabName =
133+
fileTabs.value[(fileTabIndex - 1 + fileTabs.value.length) % fileTabs.value.length]?.file.path() || '';
131134
132-
if (fileTabIndex !== -1) {
133-
selectFile(fileTabs.value[(fileTabIndex - 1 + fileTabs.value.length) % fileTabs.value.length].file.path());
135+
if (fileTabName !== '') {
136+
selectFile(fileTabName);
134137
}
135138
};
136139

src/renderer/src/components/views/SimulationExperimentView.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ const onDownloadCombineArchive = (): void => {
407407
type: 'blob',
408408
compression: 'DEFLATE'
409409
})
410-
.then((content) => {
410+
.then((content: Blob) => {
411411
common.downloadFile(`${baseFileName}.omex`, content, 'application/zip');
412412
})
413413
.catch((error: unknown) => {
@@ -490,7 +490,7 @@ let interactiveInstanceTask = interactiveInstance.task(0);
490490
const interactiveAllModelParameters = vue.ref<string[]>([]);
491491
const interactiveEditableModelParameters = vue.ref<string[]>([]);
492492
const interactiveVoiName = vue.ref(interactiveInstanceTask.voiName());
493-
const interactiveVoiId = vue.ref(interactiveVoiName.value.split('/')[1]);
493+
const interactiveVoiId = vue.ref(interactiveVoiName.value.split('/')[1] ?? '');
494494
const interactiveUiJson = vue.ref<locApi.IUiJson>(
495495
props.uiJson
496496
? JSON.parse(JSON.stringify(props.uiJson))
@@ -521,7 +521,7 @@ const interactiveUiJsonEmpty = vue.computed(() => {
521521
if (interactiveUiJson.value.output.data.length === 1) {
522522
const data = interactiveUiJson.value.output.data[0];
523523
524-
return data.id === interactiveVoiId.value && data.name === interactiveVoiName.value;
524+
return data && data.id === interactiveVoiId.value && data.name === interactiveVoiName.value;
525525
}
526526
}
527527

src/renderer/src/components/widgets/InputScientificNumber.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ vue.watch(
3939
{ immediate: true }
4040
);
4141
42-
const onUpdateModelValue = (value: string) => {
42+
const onUpdateModelValue = (value: string | undefined) => {
4343
isEditing.value = true;
44-
internalValue.value = value;
44+
internalValue.value = value ?? '';
4545
};
4646
4747
const onPaste = (event: ClipboardEvent) => {

src/renderer/src/components/widgets/InputWidget.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ const selectChange = (event: ISelectChangeEvent) => {
9494
}
9595
};
9696
97-
const inputTextValueUpdated = (newValue: number) => {
98-
if (newValue !== oldValue) {
97+
const inputTextValueUpdated = (newValue: number | undefined) => {
98+
if (newValue !== undefined && newValue !== oldValue) {
9999
let constrainedValue = newValue;
100100
101101
if (props.minimumValue !== undefined && constrainedValue < props.minimumValue) {

0 commit comments

Comments
 (0)