Skip to content

Commit 82c233e

Browse files
committed
fix: Fix diff fields containing 0 not getting reset
1 parent 311ae25 commit 82c233e

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

pages/index.vue

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Created Date: 2024-03-23 13:03:16
66
* Author: 3urobeat
77
*
8-
* Last Modified: 2024-09-01 11:24:30
8+
* Last Modified: 2024-09-01 12:23:58
99
* Modified By: 3urobeat
1010
*
1111
* Copyright (c) 2024 3urobeat <https://github.com/3urobeat>
@@ -408,18 +408,16 @@
408408
// Indicate result, reset fields on success and force refresh history
409409
const res = makeCommitResponse.data.value!;
410410
411-
console.log(res);
412-
413411
if (!res.commitResponse && !res.dummyCommitResponse) { // If both are null, both have succeeded
414412
// Indicate success
415413
responseIndicatorSuccess();
416414
417-
// Reset fields
415+
// Reset fields. Explicitly check for undefined to also clear fields containing 0 (which would obv cast to false)
418416
selectedProject.value.details.forEach((detail) => {
419417
detail.value = "";
420-
if (detail.email) detail.email = undefined;
421-
if (detail.lineDiffPlus) detail.lineDiffPlus = undefined;
422-
if (detail.lineDiffMinus) detail.lineDiffMinus = undefined;
418+
if (detail.email != undefined) detail.email = undefined;
419+
if (detail.lineDiffPlus != undefined) detail.lineDiffPlus = undefined;
420+
if (detail.lineDiffMinus != undefined) detail.lineDiffMinus = undefined;
423421
});
424422
425423
// Remove project name from changesMade array

0 commit comments

Comments
 (0)