Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/twofactor_totp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2019-10-04 20:50:58 +0300
committerRoeland Jago Douma <roeland@famdouma.nl>2019-10-08 20:48:12 +0300
commitb6044d8bae9f6e24b28cf388c86332c362b9ab46 (patch)
treeed970d0db1e47bfc0225175fd83412f64e3604cb /src
parent8ee9e185933153515889b87459cfad4277b29abb (diff)
Switch to real initial state API
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'src')
-rw-r--r--src/main-settings.js17
1 files changed, 4 insertions, 13 deletions
diff --git a/src/main-settings.js b/src/main-settings.js
index 97e0ab0..afaf1d9 100644
--- a/src/main-settings.js
+++ b/src/main-settings.js
@@ -20,7 +20,7 @@
*/
import Vue from 'vue'
-
+import { loadState } from '@nextcloud/initial-state'
import Logger from './logger'
import store from './store'
@@ -30,18 +30,9 @@ Vue.mixin({
},
})
-Logger.debug('loading initial state')
-const initialStateElement = document.getElementById(
- 'twofactor-totp-initial-state'
-)
-if (initialStateElement) {
- const state = parseInt(initialStateElement.value, 10)
- store.replaceState({
- totpState: state,
- })
-} else {
- Logger.warn('no initial state element found')
-}
+store.replaceState({
+ totpState: loadState('twofactor_totp', 'state'),
+})
import PersonalTotpSettings from './components/PersonalTotpSettings'