- Mod PreviewAction to prevent folders from being previewed;

Co-authored-by: Andrew Henry <akhenry@gmail.com>
This commit is contained in:
Charles Hacskaylo 2020-04-30 09:48:16 -07:00 committed by GitHub
parent 396817b2d1
commit cfadb9f4fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -63,7 +63,7 @@ export default class PreviewAction {
}); });
} }
appliesTo(objectPath) { appliesTo(objectPath) {
return !this._isNavigatedObject(objectPath) return !this._isNavigatedObject(objectPath) && !this._preventPreview(objectPath);
} }
_isNavigatedObject(objectPath) { _isNavigatedObject(objectPath) {
let targetObject = objectPath[0]; let targetObject = objectPath[0];
@ -71,4 +71,8 @@ export default class PreviewAction {
return targetObject.identifier.namespace === navigatedObject.identifier.namespace && return targetObject.identifier.namespace === navigatedObject.identifier.namespace &&
targetObject.identifier.key === navigatedObject.identifier.key; targetObject.identifier.key === navigatedObject.identifier.key;
} }
_preventPreview(objectPath) {
const noPreviewTypes = ['folder'];
return noPreviewTypes.includes(objectPath[0].type);
}
} }