Router: change /Discover to /Discover/map/type/filterId
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import Swal from 'sweetalert2'
|
||||
import Swal from 'sweetalert2';
|
||||
import AllMapDataStore from '@/stores/allMapData.js';
|
||||
|
||||
const customClass = {
|
||||
htmlContainer: '!w-[564px]',
|
||||
@@ -51,7 +52,8 @@ export async function savedSuccessfully(value) {
|
||||
})
|
||||
};
|
||||
|
||||
export async function leaveFilter(next, addFilterId) {
|
||||
export async function leaveFilter(next, addFilterId, toPath) {
|
||||
const allMapDataStore = AllMapDataStore();
|
||||
const result = await Swal.fire({
|
||||
title: 'ARE YOU SURE TO LEAVE MAP?',
|
||||
html: 'Filter settings have not been saved.</br>Click “Save as” to save filtered results, “OK” to leave map.',
|
||||
@@ -67,10 +69,11 @@ export async function leaveFilter(next, addFilterId) {
|
||||
})
|
||||
if(result.isConfirmed) {
|
||||
await saveFilter(addFilterId)
|
||||
next();
|
||||
next(toPath);
|
||||
}
|
||||
else if(result.dismiss === 'cancel') {
|
||||
next();
|
||||
allMapDataStore.tempFilterId = null;
|
||||
next(toPath);
|
||||
}
|
||||
else if(result.dismiss === 'backdrop') {
|
||||
next(false);
|
||||
|
||||
Reference in New Issue
Block a user