Link swipe-to-snooze in the thread list to the availability of the snooze plugin

This commit is contained in:
Ben Gotow 2021-02-15 01:34:24 -06:00 committed by Ben Gotow
parent 21fe6eeb7a
commit 17acb08ca6

View file

@ -177,12 +177,11 @@ class ThreadList extends React.Component<{}, { style: string; syncing: boolean }
callback(true);
};
const disabledPackages = AppEnv.config.get('core.disabledPackages') || [];
if (disabledPackages.includes('thread-snooze')) {
return props;
}
// Technically this should be exposed as an API so thread-snooze can register for this
// behavior, but for now we just check for it explicitly.
const snoozePresent = AppEnv.packages.isPackageActive('thread-snooze');
if (FocusedPerspectiveStore.current().isInbox()) {
if (snoozePresent && FocusedPerspectiveStore.current().isInbox()) {
props.onSwipeLeftClass = 'swipe-snooze';
props.onSwipeCenter = () => {
Actions.closePopover();