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