fix: #294 by adding next param
This commit is contained in:
@@ -19,7 +19,7 @@ const customClass = {
|
|||||||
* Map Saved
|
* Map Saved
|
||||||
* @param { function } addFilterId 後端 API
|
* @param { function } addFilterId 後端 API
|
||||||
*/
|
*/
|
||||||
export async function saveFilter(addFilterId) {
|
export async function saveFilter(addFilterId, next = null) {
|
||||||
let fileName = '';
|
let fileName = '';
|
||||||
const pageAdminStore = PageAdminStore();
|
const pageAdminStore = PageAdminStore();
|
||||||
|
|
||||||
@@ -57,6 +57,9 @@ export async function saveFilter(addFilterId) {
|
|||||||
} else { // 點擊取消或空白處,為存檔失敗。
|
} else { // 點擊取消或空白處,為存檔失敗。
|
||||||
// console.log("PageAdminStore.activePage", PageAdminStore.activePage);
|
// console.log("PageAdminStore.activePage", PageAdminStore.activePage);
|
||||||
pageAdminStore.keepPreviousPage();
|
pageAdminStore.keepPreviousPage();
|
||||||
|
|
||||||
|
// Not every time we have nontrivial next value
|
||||||
|
next !== null ? next() : 1;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -102,7 +105,7 @@ export async function leaveFilter(next, addFilterId, toPath, logOut) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if(result.isConfirmed) {
|
if(result.isConfirmed) {
|
||||||
console.log('popup confirm case', );
|
// console.log('popup confirm case', );
|
||||||
|
|
||||||
if(allMapDataStore.createFilterId) {
|
if(allMapDataStore.createFilterId) {
|
||||||
await allMapDataStore.updataFilter();
|
await allMapDataStore.updataFilter();
|
||||||
@@ -111,7 +114,7 @@ export async function leaveFilter(next, addFilterId, toPath, logOut) {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Dangerous, here shows a modal
|
// Dangerous, here shows a modal
|
||||||
await saveFilter(addFilterId);
|
await saveFilter(addFilterId, next);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle page admin issue
|
// Handle page admin issue
|
||||||
@@ -119,17 +122,17 @@ export async function leaveFilter(next, addFilterId, toPath, logOut) {
|
|||||||
|
|
||||||
logOut ? logOut() : next(toPath);
|
logOut ? logOut() : next(toPath);
|
||||||
} else if(result.dismiss === 'cancel') {
|
} else if(result.dismiss === 'cancel') {
|
||||||
console.log('popup cancel case', );
|
// console.log('popup cancel case', );
|
||||||
// Handle page admin issue
|
// Handle page admin issue
|
||||||
console.log("PageAdminStore.activePage", PageAdminStore.activePage);
|
// console.log("PageAdminStore.activePage", PageAdminStore.activePage);
|
||||||
pageAdminStore.keepPreviousPage();
|
pageAdminStore.keepPreviousPage();
|
||||||
|
|
||||||
allMapDataStore.tempFilterId = null;
|
allMapDataStore.tempFilterId = null;
|
||||||
logOut ? logOut() : next(toPath);
|
logOut ? logOut() : next(toPath);
|
||||||
} else if(result.dismiss === 'backdrop') {
|
} else if(result.dismiss === 'backdrop') {
|
||||||
console.log('popup backdrop case', );
|
// console.log('popup backdrop case', );
|
||||||
// Handle page admin issue
|
// Handle page admin issue
|
||||||
console.log("PageAdminStore.activePage", PageAdminStore.activePage);
|
// console.log("PageAdminStore.activePage", PageAdminStore.activePage);
|
||||||
pageAdminStore.keepPreviousPage();
|
pageAdminStore.keepPreviousPage();
|
||||||
|
|
||||||
logOut ? null : next(false);
|
logOut ? null : next(false);
|
||||||
|
|||||||
Reference in New Issue
Block a user