cleanup and minor fixes...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2021-02-10 00:50:31 +03:00
parent 10df416043
commit 2680a6160a
2 changed files with 10 additions and 16 deletions

View File

@ -3131,6 +3131,8 @@ var TaskActions = actions.Actions({
// Links...
//
// NOTE: all links to current state in .links will be detached on .clear()
//
// XXX after this is stabilized, do we need session tasks and its complexities???
__links: null,
get links(){
@ -3268,17 +3270,20 @@ module.Tasks = ImageGridFeatures.Feature({
handlers: [
// stop session tasks...
['clear',
// XXX BUG: for some reason calling .abort here does not work...
//'sessionTasks.stop'],
'sessionTasks.abort'],
// detach links to current state...
['clear.pre',
function(){
var that = this
Object.values(this.links || [])
.forEach(function(link){
// NOTE: we do a partial detach here as .clear(..) will
// detach the data for us...
link.detachLink(false) }) }],
// only detach links to current state...
link.data === that.data
&& link.images === that.images
// NOTE: we do a partial detach here as .clear(..) will
// detach the data for us...
&& link.detachLink(false) }) }],
],
})

View File

@ -859,10 +859,6 @@ var FileSystemLoaderActions = actions.Actions({
// independently it would require a separate wrapper...
// ...this seems quire a bit more convoluted than the current
// .indexCheckerActions + .checkIndex(..) pair...
// XXX since this by default runs in a .linked context this will update
// the current context state if it was not reloaded but .changes if
// it was set to false will not reflect the changes made by the
// checker actions...
checkIndex: ['File/Check index consistency',
core.doc`
@ -892,14 +888,7 @@ var FileSystemLoaderActions = actions.Actions({
// XXX BUG?: this is not returned by the action for some reason...
return res }) }],
// XXX add a context wrapper a-la .makeIndex(..)...
// ...might be a good idea to rename this to .checkIndexPaths(..)
// and make the .checkIndex(..) a context aggregate actions like
// .makeIndex(..)
// XXX might be a good idea to also search for previews here...
// XXX technically this can be a non-session queue, but we'll
// need to save the check results...
// XXX update .handlers to maintain .changes via promise...
checkIndexPaths: ['- File/',
core.doc`Check index image path consistency