diff --git a/store/settings/actions.ts b/store/settings/actions.ts index 7c9f528705..aed815789a 100644 --- a/store/settings/actions.ts +++ b/store/settings/actions.ts @@ -1,7 +1,6 @@ import Vue from 'vue' import { TextileError } from '../textile/types' import { db } from '~/libraries/SatelliteDB/SatelliteDB' -import TextileManager from '~/libraries/Textile/TextileManager' import { UserInfoManager } from '~/libraries/Textile/UserManager' import { SettingsError, SettingsState } from '~/store/settings/types' import { ActionsArguments } from '~/types/store/store' @@ -22,19 +21,21 @@ export default { consentScan: boolean, ) { try { - commit('setConsentScan', consentScan) - - const $TextileManager: TextileManager = Vue.prototype.$TextileManager + const $UserInfoManager: UserInfoManager = + Vue.prototype.$TextileManager.userInfoManager - if (!$TextileManager.userInfoManager) { + if (!$UserInfoManager) { throw new Error(TextileError.USERINFO_MANAGER_NOT_FOUND) } - const $UserInfoManager: UserInfoManager = $TextileManager.userInfoManager + $UserInfoManager.setConsent({ consentScan, consentDate: Date.now(), }) - } catch (e) {} + commit('setConsentScan', consentScan) + } catch (e) { + console.log(e) + } }, async setBlockNsfw( @@ -50,8 +51,9 @@ export default { } $UserInfoManager.setBlockNsfw(blockNsfw) - commit('setBlockNsfw', blockNsfw) - } catch (e) {} + } catch (e) { + console.log(e) + } }, }