Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

fix toast showing multiple times

ammarahm-ed1d52a80e60df
diff --git a/apps/mobile/src/components/Toast/index.js b/apps/mobile/src/components/Toast/index.js
index 866d8c7cd..abb7be17f 100644
--- a/apps/mobile/src/components/Toast/index.js
+++ b/apps/mobile/src/components/Toast/index.js
@@ -31,6 +31,7 @@ export const Toast = ({context = 'global'}) => {
let toastOpacity = useValue(0);
const showToastFunc = async data => {
+ console.log('toast show',data.message);
if (!data) return;
if (data.context !== context) return;
if (toastMessages.findIndex(m => m.message === data.message) >= 0) {
@@ -84,7 +85,7 @@ export const Toast = ({context = 'global'}) => {
};
const hideToastFunc = () => {
- let msg = toastMessages.shift();
+ let msg = toastMessages.length > 1 ? toastMessages.shift() : null;
if (msg) {
timing(toastOpacity, {
toValue: 0,