From 32cad6601cb5935978f85ea0964e662839ef2d8d Mon Sep 17 00:00:00 2001 From: thecodrr Date: Thu, 28 Jan 2021 11:46:18 +0500 Subject: [PATCH] feat: silence all notifications in focus mode --- apps/web/src/utils/toast.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/web/src/utils/toast.js b/apps/web/src/utils/toast.js index 2291e6c4e..d17d8daa9 100644 --- a/apps/web/src/utils/toast.js +++ b/apps/web/src/utils/toast.js @@ -4,12 +4,13 @@ import { Button, Flex, Text } from "rebass"; import ThemeProvider from "../components/theme-provider"; import * as Icon from "../components/icons"; import { toTitleCase } from "./string"; - +import { store as appstore } from "../stores/app-store"; /** * * @returns {import("cogo-toast").CTReturn} */ function showToast(type, message, actions) { + if (appstore.get().isFocusMode) return null; const IconComponent = Icon[toTitleCase(type)]; return CogoToast[type](