Skip to content

Commit

Permalink
fix(settings): in progress, move mutation below textile update so it'…
Browse files Browse the repository at this point in the history
…s more accurate
  • Loading branch information
josephmcg committed Apr 20, 2022
1 parent 9421417 commit a0c2ef2
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions store/settings/actions.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -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(
Expand All @@ -50,8 +51,9 @@ export default {
}

$UserInfoManager.setBlockNsfw(blockNsfw)

commit('setBlockNsfw', blockNsfw)
} catch (e) {}
} catch (e) {
console.log(e)
}
},
}

0 comments on commit a0c2ef2

Please sign in to comment.