Skip to content

Commit d38cbf4

Browse files
committed
Exit the API request if data is available in the sessionStorage
1 parent beead81 commit d38cbf4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

ipgeolocation.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ var _ipgeolocation = function() {
1313
if (useSessionStorage) {
1414
if (subUrl == "ipgeo" && sessionStorage.getItem("_ipGeolocation") && callback) {
1515
callback(JSON.parse(sessionStorage.getItem("_ipGeolocation")));
16+
return;
1617
} else if (subUrl == "timezone" && sessionStorage.getItem("_ipTimeZone") && callback) {
1718
callback(JSON.parse(sessionStorage.getItem("_ipTimeZone")));
19+
return;
1820
}
1921
}
2022

0 commit comments

Comments
 (0)