it boots again
This commit is contained in:
parent
3cdcb87831
commit
ebe487c5d8
8 changed files with 26 additions and 20 deletions
|
|
@ -198,7 +198,9 @@ export default {
|
|||
|
||||
...mapState(useInstanceStore, {
|
||||
instanceBackground: (store) =>
|
||||
this.mergedConfig.hideInstanceWallpaper ? null : store.background,
|
||||
useSyncConfigStore().mergedConfig.hideInstanceWallpaper
|
||||
? null
|
||||
: store.background,
|
||||
showInstanceSpecificPanel: (store) =>
|
||||
store.showInstanceSpecificPanel &&
|
||||
!useSyncConfigStore().mergedConfig.hideISP &&
|
||||
|
|
|
|||
|
|
@ -50,8 +50,8 @@ export default (store) => {
|
|||
redirect: () => {
|
||||
return (
|
||||
(store.state.users.currentUser
|
||||
? store.state.instance.redirectRootLogin
|
||||
: store.state.instance.redirectRootNoLogin) || '/main/all'
|
||||
? useInstanceStore().redirectRootLogin
|
||||
: useInstanceStore().redirectRootNoLogin) || '/main/all'
|
||||
)
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import { mapState } from 'vuex'
|
|||
import oauthApi from '../../services/new_api/oauth.js'
|
||||
|
||||
import { useAuthFlowStore } from 'src/stores/auth_flow.js'
|
||||
import { useInstanceStore } from 'src/stores/instance.js'
|
||||
import { useOAuthStore } from 'src/stores/oauth.js'
|
||||
|
||||
import { library } from '@fortawesome/fontawesome-svg-core'
|
||||
|
|
@ -25,8 +26,6 @@ const LoginForm = {
|
|||
},
|
||||
...mapStores(useOAuthStore),
|
||||
...mapState({
|
||||
registrationOpen: (state) => state.instance.registrationOpen,
|
||||
instance: (state) => state.instance,
|
||||
loggingIn: (state) => state.users.loggingIn,
|
||||
}),
|
||||
...mapPiniaState(useAuthFlowStore, [
|
||||
|
|
@ -34,6 +33,7 @@ const LoginForm = {
|
|||
'requiredToken',
|
||||
'requiredMFA',
|
||||
]),
|
||||
...mapPiniaState(useInstanceStore, ['registrationOpen', 'server']),
|
||||
},
|
||||
methods: {
|
||||
...mapActions(useAuthFlowStore, ['requireMFA', 'login']),
|
||||
|
|
@ -42,7 +42,7 @@ const LoginForm = {
|
|||
},
|
||||
submitToken() {
|
||||
const data = {
|
||||
instance: this.instance.server,
|
||||
instance: this.server,
|
||||
commit: this.$store.commit,
|
||||
}
|
||||
|
||||
|
|
@ -70,7 +70,7 @@ const LoginForm = {
|
|||
oauthApi
|
||||
.getTokenWithCredentials({
|
||||
...app,
|
||||
instance: this.instance.server,
|
||||
instance: this.server,
|
||||
username: this.user.username,
|
||||
password: this.user.password,
|
||||
})
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { mapState as mapPiniaState } from 'pinia'
|
||||
import { mapGetters, mapState } from 'vuex'
|
||||
import { mapState } from 'vuex'
|
||||
|
||||
import { useSyncConfigStore } from 'src/stores/sync_config.js'
|
||||
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@ const FilteringTab = {
|
|||
},
|
||||
...mapState(useInstanceStore, {
|
||||
instanceSpecificPanelPresent: (store) => store.showInstanceSpecificPanel,
|
||||
blockExpirationSupported: (store) => store.blockExpiration,
|
||||
blockExpirationSupported: (store) => store.featureSet.blockExpiration,
|
||||
}),
|
||||
...SharedComputedObject(),
|
||||
...mapState(useSyncConfigStore, {
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ import StringSetting from '../../helpers/string_setting.vue'
|
|||
import Preview from '../old_theme_tab/theme_preview.vue'
|
||||
import VirtualDirectivesTab from './virtual_directives_tab.vue'
|
||||
|
||||
import { useInterfaceStore } from 'src/stores/interface'
|
||||
import { useInterfaceStore, useSyncConfigStore } from 'src/stores/interface'
|
||||
|
||||
import {
|
||||
getContrastRatio,
|
||||
|
|
|
|||
|
|
@ -22,6 +22,8 @@ export const useI18nStore = defineStore('i18n', {
|
|||
setLanguage(originalValue) {
|
||||
const value =
|
||||
originalValue || useSyncConfigStore().mergedConfig.interfaceLanguage
|
||||
|
||||
console.log(useSyncConfigStore().mergedConfig)
|
||||
messages.setLanguage(this.i18n, value)
|
||||
useEmojiStore().loadUnicodeEmojiData(value)
|
||||
Cookies.set(
|
||||
|
|
|
|||
|
|
@ -19,10 +19,7 @@ import { CURRENT_UPDATE_COUNTER } from 'src/components/update_notification/updat
|
|||
|
||||
import { useInstanceStore } from 'src/stores/instance'
|
||||
|
||||
import {
|
||||
defaultState as configDefaultState,
|
||||
instanceDefaultConfig,
|
||||
} from 'src/modules/default_config_state'
|
||||
import { defaultState as configDefaultState } from 'src/modules/default_config_state'
|
||||
|
||||
export const VERSION = 2
|
||||
export const NEW_USER_DATE = new Date('2022-08-04') // date of writing this, basically
|
||||
|
|
@ -216,7 +213,7 @@ const _mergeJournal = (...journals) => {
|
|||
// side effect
|
||||
journal.sort((a, b) => (a.timestamp > b.timestamp ? 1 : -1))
|
||||
|
||||
if (path.startsWith('collections')) {
|
||||
if (path.startsWith('collections') || path.startsWith('objectCollection')) {
|
||||
const lastRemoveIndex = findLastIndex(
|
||||
journal,
|
||||
({ operation }) => operation === 'removeFromCollection',
|
||||
|
|
@ -501,7 +498,6 @@ export const useSyncConfigStore = defineStore('sync_config', {
|
|||
collection.add(_key)
|
||||
set(this.prefsStorage, path + '.index', [...collection])
|
||||
set(this.prefsStorage, path + '.data.' + _key, value)
|
||||
console.log(get(path, this.prefsStorage, path))
|
||||
}
|
||||
this.prefsStorage._journal = [
|
||||
...this.prefsStorage._journal,
|
||||
|
|
@ -660,10 +656,16 @@ export const useSyncConfigStore = defineStore('sync_config', {
|
|||
},
|
||||
},
|
||||
getters: {
|
||||
mergedConfig: (state) => ({
|
||||
...useInstanceStore().prefsStorage,
|
||||
...state.prefsStorage.simple,
|
||||
}),
|
||||
mergedConfig: (state) => {
|
||||
const instancePrefs = useInstanceStore().prefsStorage
|
||||
const result = Object.fromEntries(
|
||||
Object.entries(state.prefsStorage.simple).map(([k, v]) => [
|
||||
k,
|
||||
v ?? instancePrefs[k],
|
||||
]),
|
||||
)
|
||||
return result
|
||||
},
|
||||
},
|
||||
persist: {
|
||||
afterLoad(state) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue