I'm not an expert so there may be a better answer, but you may want to create a widget-level variable to store the current view. In each level's updateView function, you can update the value accordingly. Then, when running your conditional, you can simply check the value of that variable.
What exactly are you trying to do? I spent a day trying to figure out how to access the currentView but then solved my problem using registerMessageCenterListenerCallback to listen for a data update and update my view accordingly. That might be more applicable....
I'm trying to do a test to determine if a view is loaded or not.
I'm looking for something like debugWhatViewsLoaded, but that would RETURN a value I could use. Or a way to just get a view by ID, so I could do something like this:
CODE
if (KONtx.application.isViewLoaded('my-view')) {
// do something with the loaded view
}
else {
// load the view for the first time
}