update all ToastEvent functions

This commit is contained in:
ammarahm-ed
2021-02-20 15:03:02 +05:00
parent 680db49990
commit 05d8bca5fd
32 changed files with 607 additions and 361 deletions

View File

@@ -39,7 +39,10 @@ export const deleteItems = async (item) => {
Navigation.routeNames.Notebook,
]);
updateEvent({type: Actions.MENU_PINS});
ToastEvent.show('Topics deleted', 'success');
ToastEvent.show({
heading: 'Topics deleted',
type: 'success',
});
}
if (notebooks?.length > 0) {
@@ -57,12 +60,10 @@ export const deleteItems = async (item) => {
let itemsCopy = [...history.selectedItemsList];
if (topics.length === 0 && (notes.length > 0 || notebooks.length > 0)) {
ToastEvent.show(
message,
'success',
'global',
6000,
async () => {
ToastEvent.show({
heading: message,
type: 'success',
func: async () => {
let trash = db.trash;
let ids = [];
for (var i = 0; i < itemsCopy.length; i++) {
@@ -83,8 +84,8 @@ export const deleteItems = async (item) => {
updateEvent({type: Actions.MENU_PINS});
ToastEvent.hide();
},
'Undo',
);
actionText: 'Undo',
});
}
Navigation.setRoutesToUpdate([Navigation.routeNames.Trash]);
updateEvent({type: Actions.CLEAR_SELECTION});
@@ -92,6 +93,8 @@ export const deleteItems = async (item) => {
updateEvent({type: Actions.SELECTION_MODE, enabled: false});
};
export const openLinkInBrowser = async (link, colors) => {
try {
const url = link;