robert 2 years ago
parent
commit
3627bfc1c5
1 changed files with 3 additions and 3 deletions
  1. 3 3
      mobile/js/live_w_locator.js

+ 3 - 3
mobile/js/live_w_locator.js

@@ -1,8 +1,8 @@
 $(function() {
     var App = {
         init : function() {
-            if (localStorage.getItem('deviceId') !== null) {
-                this.state.inputStream.constraints.deviceId = localStorage.getItem('deviceId');
+            if (sessionStorage.getItem('deviceId') !== null) {
+                this.state.inputStream.constraints.deviceId = sessionStorage.getItem('deviceId');
             }
             Quagga.init(this.state, function(err) {
                 if (err) {
@@ -95,7 +95,7 @@ $(function() {
                     name = $target.attr("name"),
                     state = self._convertNameToState(name);
 
-                localStorage.setItem('deviceId', value);
+                sessionStorage.setItem('deviceId', value);
                 console.log("Value of "+ state + " changed to " + value);
                 self.setState(state, value);
             });