Skip to content

Commit 0110ee6

Browse files
committed
refactor(defaultTheme): simplify script logic
1 parent 9bfece7 commit 0110ee6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/tpl/defaultTheme/frontend/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,9 @@
137137
}
138138

139139
window.addEventListener('pagehide', function () {
140-
if (input.value) {
141-
sessionStorage.setItem(location.pathname, input.value);
140+
const inputValue = input.value;
141+
if (inputValue) {
142+
sessionStorage.setItem(location.pathname, inputValue);
142143
}
143144
});
144145

0 commit comments

Comments
 (0)