Browse Source

Preserver searchers on document change

master
Radu Liviu Carjan 3 years ago
parent
commit
284e8d51ba
  1. 12
      resources/js/components/ProcessFile/ProcessFile.ts

12
resources/js/components/ProcessFile/ProcessFile.ts

@ -70,6 +70,16 @@ export default class ProcessFile extends Vue {
*
*/
created() {
let storedSearchers = localStorage.getItem('searchers');
if (storedSearchers !== null) {
this.selectedSearchers = JSON.parse(storedSearchers);
let searchersOptions = localStorage.getItem('searchersOptions');
if (searchersOptions !== null) {
this.searchersOptions = JSON.parse(searchersOptions);
}
}
this.intervalId = setInterval(this.waitForFile, 3000);
window.addEventListener('beforeunload', async (event) => {
@ -155,6 +165,8 @@ export default class ProcessFile extends Vue {
* @param event The event containing the uploaded files information
*/
public async uploadFile(event: any): Promise<void> {
localStorage.setItem('searchers', JSON.stringify(this.selectedSearchers));
localStorage.setItem('searchersOptions', JSON.stringify(this.searchersOptions));
this.$confirm.require({
message: 'You will lose any progress on the current uploaded document. Are you sure you want to proceed?',
header: 'Confirmation',

Loading…
Cancel
Save