@@ -26,19 +26,19 @@ export default {
2626 },
2727 mounted () {
2828
29- let inventoryListInDb = localStorage .getItem (" inventoryList" );
29+ let inventoryListInDb = sessionStorage .getItem (" inventoryList" );
3030
3131 if (inventoryListInDb) {
3232 this .inventoryList = JSON .parse (inventoryListInDb);
3333 }
3434
35- let transactionsListInDb = localStorage .getItem (" transactionsList" );
35+ let transactionsListInDb = sessionStorage .getItem (" transactionsList" );
3636
3737 if (transactionsListInDb) {
3838 this .transactionsList = JSON .parse (transactionsListInDb);
3939 }
4040
41- let parentIdInDb = localStorage .getItem (" parentId" );
41+ let parentIdInDb = sessionStorage .getItem (" parentId" );
4242
4343 if (parentIdInDb) {
4444 this .parentId = parentIdInDb;
@@ -52,7 +52,7 @@ export default {
5252 });
5353 }
5454
55- this .mode = localStorage .getItem (" mode" );
55+ this .mode = sessionStorage .getItem (" mode" );
5656
5757 document .addEventListener (" click" , this .ensureFocus );
5858 },
@@ -105,8 +105,8 @@ export default {
105105
106106 this .inventoryList = data .asset_data .child_assets ;
107107
108- localStorage .setItem (' parentId' , this .parentId );
109- localStorage .setItem (' inventoryList' , JSON .stringify (this .inventoryList ));
108+ sessionStorage .setItem (' parentId' , this .parentId );
109+ sessionStorage .setItem (' inventoryList' , JSON .stringify (this .inventoryList ));
110110 this .closeModal ();
111111
112112 this .$nextTick (() => {
@@ -160,7 +160,7 @@ export default {
160160 if (! isAssetExist) {
161161 const foundAsset = data .parent_data .child_assets .find (asset => asset .Name === transaction .assetId );
162162 this .inventoryList .unshift (foundAsset);
163- localStorage .setItem (' inventoryList' , JSON .stringify (this .inventoryList ));
163+ sessionStorage .setItem (' inventoryList' , JSON .stringify (this .inventoryList ));
164164 }
165165
166166 } else if (transaction .response_type === " Problem" ) {
@@ -169,7 +169,7 @@ export default {
169169 playErrorSound ();
170170 }
171171
172- localStorage .setItem (' transactionsList' , JSON .stringify (this .transactionsList ));
172+ sessionStorage .setItem (' transactionsList' , JSON .stringify (this .transactionsList ));
173173 } catch (error) {
174174 console .error (" API Error:" , error);
175175 } finally {
@@ -199,7 +199,7 @@ export default {
199199 if (! isAssetExist) {
200200 const foundAsset = data .parent_data .child_assets .find (asset => asset .Name === forcedAsset .assetId );
201201 this .inventoryList .unshift (foundAsset);
202- localStorage .setItem (' inventoryList' , JSON .stringify (this .inventoryList ));
202+ sessionStorage .setItem (' inventoryList' , JSON .stringify (this .inventoryList ));
203203 }
204204
205205 } else if (forcedAsset .response_type === " Problem" ) {
@@ -208,7 +208,7 @@ export default {
208208 playErrorSound ();
209209 }
210210
211- localStorage .setItem (' transactionsList' , JSON .stringify (this .transactionsList ));
211+ sessionStorage .setItem (' transactionsList' , JSON .stringify (this .transactionsList ));
212212 } catch (error) {
213213 console .error (" API Error:" , error);
214214 } finally {
@@ -246,10 +246,10 @@ export default {
246246 endSession () {
247247 // Remove event listener before component is destroyed
248248 document .removeEventListener (" click" , this .ensureFocus );
249- localStorage .removeItem (' mode' );
250- localStorage .removeItem (' parentId' );
251- localStorage .removeItem (' inventoryList' );
252- localStorage .removeItem (' transactionsList' );
249+ sessionStorage .removeItem (' mode' );
250+ sessionStorage .removeItem (' parentId' );
251+ sessionStorage .removeItem (' inventoryList' );
252+ sessionStorage .removeItem (' transactionsList' );
253253
254254 this .$router .push (" /" );
255255 }
0 commit comments