@@ -20,7 +20,7 @@ import { TASK_OUTPUT_NAMES } from '@/model/TaskOutput.model'
2020
2121/**
2222 * States used when the parent is stopped.
23- * @type {Array< TaskState> }
23+ * @type {TaskState[] }
2424 */
2525const isStoppedOrderedStates = [
2626 TaskState . SUBMIT_FAILED ,
@@ -35,9 +35,9 @@ const isStoppedOrderedStates = [
3535
3636/**
3737 * Gives a single state, based on a list of states of children nodes.
38- * @param childStates {Array< TaskState>} children nodes
39- * @param isStopped {boolean} whether the parent node is stopped or not
40- * @returns {string } a valid Task State name, or null if not found
38+ * @param { TaskState[] } childStates children nodes
39+ * @param {boolean } isStopped whether the parent node is stopped or not
40+ * @returns {string } a valid Task State name, or empty string if not found
4141 * @link @see https://github.com/cylc/cylc-flow/blob/d66ae5c3ce8c749c8178d1cd53cb8c81d1560346/lib/cylc/task_state_prop.py
4242 */
4343function extractGroupState ( childStates , isStopped = false ) {
@@ -51,10 +51,7 @@ function extractGroupState (childStates, isStopped = false) {
5151}
5252
5353function latestJob ( taskProxy ) {
54- if ( taskProxy && taskProxy . children && taskProxy . children . length > 0 ) {
55- return taskProxy . children [ 0 ] . node
56- }
57- return null
54+ return taskProxy ?. children ?. [ 0 ] ?. node
5855}
5956
6057/** Returns an array of task messages and custom outputs for a job node.
0 commit comments