post-merge headache
This commit is contained in:
parent
3530830b07
commit
90ac30249b
18 changed files with 90 additions and 91 deletions
|
|
@ -17,7 +17,7 @@ config.autoAddCss = false
|
||||||
import App from '../App.vue'
|
import App from '../App.vue'
|
||||||
import backendInteractorService from '../services/backend_interactor_service/backend_interactor_service.js'
|
import backendInteractorService from '../services/backend_interactor_service/backend_interactor_service.js'
|
||||||
import FaviconService from '../services/favicon_service/favicon_service.js'
|
import FaviconService from '../services/favicon_service/favicon_service.js'
|
||||||
import { applyConfig } from '../services/style_setter/style_setter.js'
|
import { applyStyleConfig } from '../services/style_setter/style_setter.js'
|
||||||
import { initServiceWorker, updateFocus } from '../services/sw/sw.js'
|
import { initServiceWorker, updateFocus } from '../services/sw/sw.js'
|
||||||
import {
|
import {
|
||||||
windowHeight,
|
windowHeight,
|
||||||
|
|
@ -88,25 +88,25 @@ const getInstanceConfig = async ({ store }) => {
|
||||||
data.pleroma,
|
data.pleroma,
|
||||||
)
|
)
|
||||||
useInstanceStore().set({
|
useInstanceStore().set({
|
||||||
name: 'textlimit',
|
path: 'textlimit',
|
||||||
value: textlimit,
|
value: textlimit,
|
||||||
})
|
})
|
||||||
useInstanceStore().set({
|
useInstanceStore().set({
|
||||||
name: 'accountApprovalRequired',
|
path: 'accountApprovalRequired',
|
||||||
value: data.approval_required,
|
value: data.approval_required,
|
||||||
})
|
})
|
||||||
useInstanceStore().set({
|
useInstanceStore().set({
|
||||||
name: 'birthdayRequired',
|
path: 'birthdayRequired',
|
||||||
value: !!data.pleroma?.metadata.birthday_required,
|
value: !!data.pleroma?.metadata.birthday_required,
|
||||||
})
|
})
|
||||||
useInstanceStore().set({
|
useInstanceStore().set({
|
||||||
name: 'birthdayMinAge',
|
path: 'birthdayMinAge',
|
||||||
value: data.pleroma?.metadata.birthday_min_age || 0,
|
value: data.pleroma?.metadata.birthday_min_age || 0,
|
||||||
})
|
})
|
||||||
|
|
||||||
if (vapidPublicKey) {
|
if (vapidPublicKey) {
|
||||||
useInstanceStore().set({
|
useInstanceStore().set({
|
||||||
name: 'vapidPublicKey',
|
path: 'vapidPublicKey',
|
||||||
value: vapidPublicKey,
|
value: vapidPublicKey,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
@ -258,7 +258,7 @@ const getAppSecret = async ({ store }) => {
|
||||||
const resolveStaffAccounts = ({ store, accounts }) => {
|
const resolveStaffAccounts = ({ store, accounts }) => {
|
||||||
const nicknames = accounts.map((uri) => uri.split('/').pop())
|
const nicknames = accounts.map((uri) => uri.split('/').pop())
|
||||||
useInstanceStore().set({
|
useInstanceStore().set({
|
||||||
name: 'staffAccounts',
|
path: 'staffAccounts',
|
||||||
value: nicknames,
|
value: nicknames,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
@ -384,20 +384,20 @@ const getNodeInfo = async ({ store }) => {
|
||||||
|
|
||||||
const software = data.software
|
const software = data.software
|
||||||
useInstanceStore().set({
|
useInstanceStore().set({
|
||||||
name: 'backendVersion',
|
path: 'backendVersion',
|
||||||
value: software.version,
|
value: software.version,
|
||||||
})
|
})
|
||||||
useInstanceStore().set({
|
useInstanceStore().set({
|
||||||
name: 'backendRepository',
|
path: 'backendRepository',
|
||||||
value: software.repository,
|
value: software.repository,
|
||||||
})
|
})
|
||||||
|
|
||||||
const priv = metadata.private
|
const priv = metadata.private
|
||||||
useInstanceStore().set({ name: 'privateMode', value: priv })
|
useInstanceStore().set({ path: 'privateMode', value: priv })
|
||||||
|
|
||||||
const frontendVersion = window.___pleromafe_commit_hash
|
const frontendVersion = window.___pleromafe_commit_hash
|
||||||
useInstanceStore().set({
|
useInstanceStore().set({
|
||||||
name: 'frontendVersion',
|
path: 'frontendVersion',
|
||||||
value: frontendVersion,
|
value: frontendVersion,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
@ -547,7 +547,7 @@ const afterStoreSetup = async ({ pinia, store, storageError, i18n }) => {
|
||||||
return Promise.reject(e)
|
return Promise.reject(e)
|
||||||
}
|
}
|
||||||
|
|
||||||
applyConfig(store.state.config, i18n.global)
|
applyStyleConfig(store.state.config, i18n.global)
|
||||||
|
|
||||||
// Now we can try getting the server settings and logging in
|
// Now we can try getting the server settings and logging in
|
||||||
// Most of these are preloaded into the index.html so blocking is minimized
|
// Most of these are preloaded into the index.html so blocking is minimized
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,6 @@ import { mapActions, mapState, mapStores } from 'pinia'
|
||||||
|
|
||||||
import mfaApi from '../../services/new_api/mfa.js'
|
import mfaApi from '../../services/new_api/mfa.js'
|
||||||
|
|
||||||
import mfaApi from '../../services/new_api/mfa.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 { useInstanceStore } from 'src/stores/instance.js'
|
||||||
import { useOAuthStore } from 'src/stores/oauth.js'
|
import { useOAuthStore } from 'src/stores/oauth.js'
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ import SideDrawer from '../side_drawer/side_drawer.vue'
|
||||||
|
|
||||||
import { useAnnouncementsStore } from 'src/stores/announcements.js'
|
import { useAnnouncementsStore } from 'src/stores/announcements.js'
|
||||||
import { useInstanceStore } from 'src/stores/instance.js'
|
import { useInstanceStore } from 'src/stores/instance.js'
|
||||||
import { useServerSideStorageStore } from 'src/stores/serverSideStorage.js'
|
import { useSyncConfigStore } from 'src/stores/sync_config.js'
|
||||||
|
|
||||||
import { library } from '@fortawesome/fontawesome-svg-core'
|
import { library } from '@fortawesome/fontawesome-svg-core'
|
||||||
import {
|
import {
|
||||||
|
|
@ -75,7 +75,7 @@ const MobileNav = {
|
||||||
return this.$route.name === 'chat'
|
return this.$route.name === 'chat'
|
||||||
},
|
},
|
||||||
...mapState(useAnnouncementsStore, ['unreadAnnouncementCount']),
|
...mapState(useAnnouncementsStore, ['unreadAnnouncementCount']),
|
||||||
...mapState(useServerSideStorageStore, {
|
...mapState(useSyncConfigStore, {
|
||||||
pinnedItems: (store) =>
|
pinnedItems: (store) =>
|
||||||
new Set(store.prefsStorage.collections.pinnedNavItems).has('chats'),
|
new Set(store.prefsStorage.collections.pinnedNavItems).has('chats'),
|
||||||
}),
|
}),
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ import NavigationPins from 'src/components/navigation/navigation_pins.vue'
|
||||||
import { useAnnouncementsStore } from 'src/stores/announcements'
|
import { useAnnouncementsStore } from 'src/stores/announcements'
|
||||||
import { useInstanceStore } from 'src/stores/instance.js'
|
import { useInstanceStore } from 'src/stores/instance.js'
|
||||||
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
||||||
import { useServerSideStorageStore } from 'src/stores/serverSideStorage'
|
import { useSyncConfigStore } from 'src/stores/sync_config.js'
|
||||||
|
|
||||||
import { library } from '@fortawesome/fontawesome-svg-core'
|
import { library } from '@fortawesome/fontawesome-svg-core'
|
||||||
import {
|
import {
|
||||||
|
|
@ -84,28 +84,28 @@ const NavPanel = {
|
||||||
this.editMode = !this.editMode
|
this.editMode = !this.editMode
|
||||||
},
|
},
|
||||||
toggleCollapse() {
|
toggleCollapse() {
|
||||||
useServerSideStorageStore().setPreference({
|
useSyncConfigStore().setPreference({
|
||||||
path: 'simple.collapseNav',
|
path: 'simple.collapseNav',
|
||||||
value: !this.collapsed,
|
value: !this.collapsed,
|
||||||
})
|
})
|
||||||
useServerSideStorageStore().pushServerSideStorage()
|
useSyncConfigStore().pushSyncConfig()
|
||||||
},
|
},
|
||||||
isPinned(item) {
|
isPinned(item) {
|
||||||
return this.pinnedItems.has(item)
|
return this.pinnedItems.has(item)
|
||||||
},
|
},
|
||||||
togglePin(item) {
|
togglePin(item) {
|
||||||
if (this.isPinned(item)) {
|
if (this.isPinned(item)) {
|
||||||
useServerSideStorageStore().removeCollectionPreference({
|
useSyncConfigStore().removeCollectionPreference({
|
||||||
path: 'collections.pinnedNavItems',
|
path: 'collections.pinnedNavItems',
|
||||||
value: item,
|
value: item,
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
useServerSideStorageStore().addCollectionPreference({
|
useSyncConfigStore().addCollectionPreference({
|
||||||
path: 'collections.pinnedNavItems',
|
path: 'collections.pinnedNavItems',
|
||||||
value: item,
|
value: item,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
useServerSideStorageStore().pushServerSideStorage()
|
useSyncConfigStore().pushSyncConfig()
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
|
@ -122,7 +122,7 @@ const NavPanel = {
|
||||||
...mapPiniaState(useInstanceStore, {
|
...mapPiniaState(useInstanceStore, {
|
||||||
privateMode: (store) => store.private,
|
privateMode: (store) => store.private,
|
||||||
}),
|
}),
|
||||||
...mapPiniaState(useServerSideStorageStore, {
|
...mapPiniaState(useSyncConfigStore, {
|
||||||
collapsed: (store) => store.prefsStorage.simple.collapseNav,
|
collapsed: (store) => store.prefsStorage.simple.collapseNav,
|
||||||
pinnedItems: (store) =>
|
pinnedItems: (store) =>
|
||||||
new Set(store.prefsStorage.collections.pinnedNavItems),
|
new Set(store.prefsStorage.collections.pinnedNavItems),
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import { routeTo } from 'src/components/navigation/navigation.js'
|
||||||
import OptionalRouterLink from 'src/components/optional_router_link/optional_router_link.vue'
|
import OptionalRouterLink from 'src/components/optional_router_link/optional_router_link.vue'
|
||||||
|
|
||||||
import { useAnnouncementsStore } from 'src/stores/announcements.js'
|
import { useAnnouncementsStore } from 'src/stores/announcements.js'
|
||||||
import { useServerSideStorageStore } from 'src/stores/serverSideStorage.js'
|
import { useSyncConfigStore } from 'src/stores/sync_config.js'
|
||||||
|
|
||||||
import { library } from '@fortawesome/fontawesome-svg-core'
|
import { library } from '@fortawesome/fontawesome-svg-core'
|
||||||
import { faThumbtack } from '@fortawesome/free-solid-svg-icons'
|
import { faThumbtack } from '@fortawesome/free-solid-svg-icons'
|
||||||
|
|
@ -23,17 +23,17 @@ const NavigationEntry = {
|
||||||
},
|
},
|
||||||
togglePin(value) {
|
togglePin(value) {
|
||||||
if (this.isPinned(value)) {
|
if (this.isPinned(value)) {
|
||||||
useServerSideStorageStore().removeCollectionPreference({
|
useSyncConfigStore().removeCollectionPreference({
|
||||||
path: 'collections.pinnedNavItems',
|
path: 'collections.pinnedNavItems',
|
||||||
value,
|
value,
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
useServerSideStorageStore().addCollectionPreference({
|
useSyncConfigStore().addCollectionPreference({
|
||||||
path: 'collections.pinnedNavItems',
|
path: 'collections.pinnedNavItems',
|
||||||
value,
|
value,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
useServerSideStorageStore().pushServerSideStorage()
|
useSyncConfigStore().pushSyncConfig()
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
|
@ -47,7 +47,7 @@ const NavigationEntry = {
|
||||||
...mapState({
|
...mapState({
|
||||||
currentUser: (state) => state.users.currentUser,
|
currentUser: (state) => state.users.currentUser,
|
||||||
}),
|
}),
|
||||||
...mapPiniaState(useServerSideStorageStore, {
|
...mapPiniaState(useSyncConfigStore, {
|
||||||
pinnedItems: (store) =>
|
pinnedItems: (store) =>
|
||||||
new Set(store.prefsStorage.collections.pinnedNavItems),
|
new Set(store.prefsStorage.collections.pinnedNavItems),
|
||||||
}),
|
}),
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ import { useBookmarkFoldersStore } from 'src/stores/bookmark_folders'
|
||||||
import { useInstanceStore } from 'src/stores/instance.js'
|
import { useInstanceStore } from 'src/stores/instance.js'
|
||||||
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
||||||
import { useListsStore } from 'src/stores/lists'
|
import { useListsStore } from 'src/stores/lists'
|
||||||
import { useServerSideStorageStore } from 'src/stores/serverSideStorage'
|
import { useSyncConfigStore } from 'src/stores/sync_config.js'
|
||||||
|
|
||||||
import { library } from '@fortawesome/fontawesome-svg-core'
|
import { library } from '@fortawesome/fontawesome-svg-core'
|
||||||
import {
|
import {
|
||||||
|
|
@ -70,7 +70,7 @@ const NavPanel = {
|
||||||
...mapPiniaState(useBookmarkFoldersStore, {
|
...mapPiniaState(useBookmarkFoldersStore, {
|
||||||
bookmarks: getBookmarkFolderEntries,
|
bookmarks: getBookmarkFolderEntries,
|
||||||
}),
|
}),
|
||||||
...mapPiniaState(useServerSideStorageStore, {
|
...mapPiniaState(useSyncConfigStore, {
|
||||||
pinnedItems: (store) =>
|
pinnedItems: (store) =>
|
||||||
new Set(store.prefsStorage.collections.pinnedNavItems),
|
new Set(store.prefsStorage.collections.pinnedNavItems),
|
||||||
}),
|
}),
|
||||||
|
|
|
||||||
|
|
@ -345,7 +345,8 @@ export default {
|
||||||
},
|
},
|
||||||
matchesExpertLevel() {
|
matchesExpertLevel() {
|
||||||
const settingExpertLevel = this.expert || 0
|
const settingExpertLevel = this.expert || 0
|
||||||
const userToggleExpert = this.$store.state.config.expertLevel || 0
|
const userToggleExpert =
|
||||||
|
useSyncConfigStore().mergedConfig.expertLevel || 0
|
||||||
|
|
||||||
return settingExpertLevel <= userToggleExpert
|
return settingExpertLevel <= userToggleExpert
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ import PanelLoading from 'src/components/panel_loading/panel_loading.vue'
|
||||||
import Popover from '../popover/popover.vue'
|
import Popover from '../popover/popover.vue'
|
||||||
|
|
||||||
import { useInterfaceStore } from 'src/stores/interface.js'
|
import { useInterfaceStore } from 'src/stores/interface.js'
|
||||||
|
import { useSyncConfigStore } from 'src/stores/sync_config.js'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
newExporter,
|
newExporter,
|
||||||
|
|
@ -191,11 +192,11 @@ const SettingsModal = {
|
||||||
}),
|
}),
|
||||||
expertLevel: {
|
expertLevel: {
|
||||||
get() {
|
get() {
|
||||||
return this.$store.state.config.expertLevel > 0
|
return useSyncConfigStore().mergedConfig.expertLevel > 0
|
||||||
},
|
},
|
||||||
set(value) {
|
set(value) {
|
||||||
this.$store.dispatch('setOption', {
|
useSyncConfigStore().setPreference({
|
||||||
name: 'expertLevel',
|
path: 'simple.expertLevel',
|
||||||
value: value ? 1 : 0,
|
value: value ? 1 : 0,
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ import UnitSetting from '../helpers/unit_setting.vue'
|
||||||
|
|
||||||
import { useInstanceStore } from 'src/stores/instance.js'
|
import { useInstanceStore } from 'src/stores/instance.js'
|
||||||
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
||||||
import { useServerSideStorageStore } from 'src/stores/serverSideStorage'
|
import { useSyncConfigStore } from 'src/stores/sync_config.js'
|
||||||
|
|
||||||
const ClutterTab = {
|
const ClutterTab = {
|
||||||
components: {
|
components: {
|
||||||
|
|
@ -33,7 +33,7 @@ const ClutterTab = {
|
||||||
store.instanceIdentity.showInstanceSpecificPanel &&
|
store.instanceIdentity.showInstanceSpecificPanel &&
|
||||||
store.instanceIdentity.instanceSpecificPanelContent,
|
store.instanceIdentity.instanceSpecificPanelContent,
|
||||||
}),
|
}),
|
||||||
...mapState(useServerSideStorageStore, {
|
...mapState(useSyncConfigStore, {
|
||||||
muteFilters: (store) =>
|
muteFilters: (store) =>
|
||||||
Object.entries(store.prefsStorage.simple.muteFilters),
|
Object.entries(store.prefsStorage.simple.muteFilters),
|
||||||
muteFiltersObject: (store) => store.prefsStorage.simple.muteFilters,
|
muteFiltersObject: (store) => store.prefsStorage.simple.muteFilters,
|
||||||
|
|
@ -89,10 +89,10 @@ const ClutterTab = {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapActions(useServerSideStorageStore, [
|
...mapActions(useSyncConfigStore, [
|
||||||
'setPreference',
|
'setPreference',
|
||||||
'unsetPreference',
|
'unsetPreference',
|
||||||
'pushServerSideStorage',
|
'pushSyncConfig',
|
||||||
]),
|
]),
|
||||||
getDatetimeLocal(timestamp) {
|
getDatetimeLocal(timestamp) {
|
||||||
const date = new Date(timestamp)
|
const date = new Date(timestamp)
|
||||||
|
|
@ -139,7 +139,7 @@ const ClutterTab = {
|
||||||
filter.order = this.muteFilters.length + 2
|
filter.order = this.muteFilters.length + 2
|
||||||
this.muteFiltersDraftObject[newId] = filter
|
this.muteFiltersDraftObject[newId] = filter
|
||||||
this.setPreference({ path: 'simple.muteFilters.' + newId, value: filter })
|
this.setPreference({ path: 'simple.muteFilters.' + newId, value: filter })
|
||||||
this.pushServerSideStorage()
|
this.pushSyncConfig()
|
||||||
},
|
},
|
||||||
exportFilter(id) {
|
exportFilter(id) {
|
||||||
this.exportedFilter = { ...this.muteFiltersDraftObject[id] }
|
this.exportedFilter = { ...this.muteFiltersDraftObject[id] }
|
||||||
|
|
@ -155,19 +155,19 @@ const ClutterTab = {
|
||||||
|
|
||||||
this.muteFiltersDraftObject[newId] = filter
|
this.muteFiltersDraftObject[newId] = filter
|
||||||
this.setPreference({ path: 'simple.muteFilters.' + newId, value: filter })
|
this.setPreference({ path: 'simple.muteFilters.' + newId, value: filter })
|
||||||
this.pushServerSideStorage()
|
this.pushSyncConfig()
|
||||||
},
|
},
|
||||||
deleteFilter(id) {
|
deleteFilter(id) {
|
||||||
delete this.muteFiltersDraftObject[id]
|
delete this.muteFiltersDraftObject[id]
|
||||||
this.unsetPreference({ path: 'simple.muteFilters.' + id, value: null })
|
this.unsetPreference({ path: 'simple.muteFilters.' + id, value: null })
|
||||||
this.pushServerSideStorage()
|
this.pushSyncConfig()
|
||||||
},
|
},
|
||||||
purgeExpiredFilters() {
|
purgeExpiredFilters() {
|
||||||
this.muteFiltersExpired.forEach(([id]) => {
|
this.muteFiltersExpired.forEach(([id]) => {
|
||||||
delete this.muteFiltersDraftObject[id]
|
delete this.muteFiltersDraftObject[id]
|
||||||
this.unsetPreference({ path: 'simple.muteFilters.' + id, value: null })
|
this.unsetPreference({ path: 'simple.muteFilters.' + id, value: null })
|
||||||
})
|
})
|
||||||
this.pushServerSideStorage()
|
this.pushSyncConfig()
|
||||||
},
|
},
|
||||||
updateFilter(id, field, value) {
|
updateFilter(id, field, value) {
|
||||||
const filter = { ...this.muteFiltersDraftObject[id] }
|
const filter = { ...this.muteFiltersDraftObject[id] }
|
||||||
|
|
@ -193,7 +193,7 @@ const ClutterTab = {
|
||||||
path: 'simple.muteFilters.' + id,
|
path: 'simple.muteFilters.' + id,
|
||||||
value: this.muteFiltersDraftObject[id],
|
value: this.muteFiltersDraftObject[id],
|
||||||
})
|
})
|
||||||
this.pushServerSideStorage()
|
this.pushSyncConfig()
|
||||||
this.muteFiltersDraftDirty[id] = false
|
this.muteFiltersDraftDirty[id] = false
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ import UnitSetting from '../helpers/unit_setting.vue'
|
||||||
|
|
||||||
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
||||||
import { useInterfaceStore } from 'src/stores/interface'
|
import { useInterfaceStore } from 'src/stores/interface'
|
||||||
import { useServerSideStorageStore } from 'src/stores/serverSideStorage'
|
import { useSyncConfigStore } from 'src/stores/sync_config.js'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
newExporter,
|
newExporter,
|
||||||
|
|
@ -36,11 +36,11 @@ const FilteringTab = {
|
||||||
label: this.$t(`user_card.mute_block_${mode}`),
|
label: this.$t(`user_card.mute_block_${mode}`),
|
||||||
})),
|
})),
|
||||||
muteFiltersDraftObject: cloneDeep(
|
muteFiltersDraftObject: cloneDeep(
|
||||||
useServerSideStorageStore().prefsStorage.simple.muteFilters,
|
useSyncConfigStore().prefsStorage.simple.muteFilters,
|
||||||
),
|
),
|
||||||
muteFiltersDraftDirty: Object.fromEntries(
|
muteFiltersDraftDirty: Object.fromEntries(
|
||||||
Object.entries(
|
Object.entries(
|
||||||
useServerSideStorageStore().prefsStorage.simple.muteFilters,
|
useSyncConfigStore().prefsStorage.simple.muteFilters,
|
||||||
).map(([k]) => [k, false]),
|
).map(([k]) => [k, false]),
|
||||||
),
|
),
|
||||||
exportedFilter: null,
|
exportedFilter: null,
|
||||||
|
|
@ -92,7 +92,7 @@ const FilteringTab = {
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...SharedComputedObject(),
|
...SharedComputedObject(),
|
||||||
...mapState(useServerSideStorageStore, {
|
...mapState(useSyncConfigStore, {
|
||||||
muteFilters: (store) =>
|
muteFilters: (store) =>
|
||||||
Object.entries(store.prefsStorage.simple.muteFilters),
|
Object.entries(store.prefsStorage.simple.muteFilters),
|
||||||
muteFiltersObject: (store) => store.prefsStorage.simple.muteFilters,
|
muteFiltersObject: (store) => store.prefsStorage.simple.muteFilters,
|
||||||
|
|
@ -149,10 +149,10 @@ const FilteringTab = {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapActions(useServerSideStorageStore, [
|
...mapActions(useSyncConfigStore, [
|
||||||
'setPreference',
|
'setPreference',
|
||||||
'unsetPreference',
|
'unsetPreference',
|
||||||
'pushServerSideStorage',
|
'pushSyncConfig',
|
||||||
]),
|
]),
|
||||||
getDatetimeLocal(timestamp) {
|
getDatetimeLocal(timestamp) {
|
||||||
const date = new Date(timestamp)
|
const date = new Date(timestamp)
|
||||||
|
|
@ -199,7 +199,7 @@ const FilteringTab = {
|
||||||
filter.order = this.muteFilters.length + 2
|
filter.order = this.muteFilters.length + 2
|
||||||
this.muteFiltersDraftObject[newId] = filter
|
this.muteFiltersDraftObject[newId] = filter
|
||||||
this.setPreference({ path: 'simple.muteFilters.' + newId, value: filter })
|
this.setPreference({ path: 'simple.muteFilters.' + newId, value: filter })
|
||||||
this.pushServerSideStorage()
|
this.pushSyncConfig()
|
||||||
},
|
},
|
||||||
exportFilter(id) {
|
exportFilter(id) {
|
||||||
this.exportedFilter = { ...this.muteFiltersDraftObject[id] }
|
this.exportedFilter = { ...this.muteFiltersDraftObject[id] }
|
||||||
|
|
@ -215,19 +215,19 @@ const FilteringTab = {
|
||||||
|
|
||||||
this.muteFiltersDraftObject[newId] = filter
|
this.muteFiltersDraftObject[newId] = filter
|
||||||
this.setPreference({ path: 'simple.muteFilters.' + newId, value: filter })
|
this.setPreference({ path: 'simple.muteFilters.' + newId, value: filter })
|
||||||
this.pushServerSideStorage()
|
this.pushSyncConfig()
|
||||||
},
|
},
|
||||||
deleteFilter(id) {
|
deleteFilter(id) {
|
||||||
delete this.muteFiltersDraftObject[id]
|
delete this.muteFiltersDraftObject[id]
|
||||||
this.unsetPreference({ path: 'simple.muteFilters.' + id, value: null })
|
this.unsetPreference({ path: 'simple.muteFilters.' + id, value: null })
|
||||||
this.pushServerSideStorage()
|
this.pushSyncConfig()
|
||||||
},
|
},
|
||||||
purgeExpiredFilters() {
|
purgeExpiredFilters() {
|
||||||
this.muteFiltersExpired.forEach(([id]) => {
|
this.muteFiltersExpired.forEach(([id]) => {
|
||||||
delete this.muteFiltersDraftObject[id]
|
delete this.muteFiltersDraftObject[id]
|
||||||
this.unsetPreference({ path: 'simple.muteFilters.' + id, value: null })
|
this.unsetPreference({ path: 'simple.muteFilters.' + id, value: null })
|
||||||
})
|
})
|
||||||
this.pushServerSideStorage()
|
this.pushSyncConfig()
|
||||||
},
|
},
|
||||||
updateFilter(id, field, value) {
|
updateFilter(id, field, value) {
|
||||||
const filter = { ...this.muteFiltersDraftObject[id] }
|
const filter = { ...this.muteFiltersDraftObject[id] }
|
||||||
|
|
@ -253,7 +253,7 @@ const FilteringTab = {
|
||||||
path: 'simple.muteFilters.' + id,
|
path: 'simple.muteFilters.' + id,
|
||||||
value: this.muteFiltersDraftObject[id],
|
value: this.muteFiltersDraftObject[id],
|
||||||
})
|
})
|
||||||
this.pushServerSideStorage()
|
this.pushSyncConfig()
|
||||||
this.muteFiltersDraftDirty[id] = false
|
this.muteFiltersDraftDirty[id] = false
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ import UnitSetting from '../helpers/unit_setting.vue'
|
||||||
|
|
||||||
import { useInstanceStore } from 'src/stores/instance.js'
|
import { useInstanceStore } from 'src/stores/instance.js'
|
||||||
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
||||||
|
import { useSyncConfigStore } from 'src/stores/sync_config.js'
|
||||||
|
|
||||||
import localeService from 'src/services/locale/locale.service.js'
|
import localeService from 'src/services/locale/locale.service.js'
|
||||||
|
|
||||||
|
|
@ -48,6 +49,9 @@ const GeneralTab = {
|
||||||
},
|
},
|
||||||
...SharedComputedObject(),
|
...SharedComputedObject(),
|
||||||
...mapState(useInstanceCapabilitiesStore, ['blockExpiration']),
|
...mapState(useInstanceCapabilitiesStore, ['blockExpiration']),
|
||||||
|
...mapState(useSyncConfigStore, {
|
||||||
|
theme3hacks: (store) => store.mergedConfig.theme3hacks,
|
||||||
|
}),
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
updateProfile() {
|
updateProfile() {
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ import UserPopover from '../user_popover/user_popover.vue'
|
||||||
|
|
||||||
import { useInstanceStore } from 'src/stores/instance.js'
|
import { useInstanceStore } from 'src/stores/instance.js'
|
||||||
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
||||||
import { useServerSideStorageStore } from 'src/stores/serverSideStorage'
|
import { useSyncConfigStore } from 'src/stores/sync_config.js'
|
||||||
|
|
||||||
import generateProfileLink from 'src/services/user_profile_link_generator/user_profile_link_generator'
|
import generateProfileLink from 'src/services/user_profile_link_generator/user_profile_link_generator'
|
||||||
|
|
||||||
|
|
@ -259,9 +259,7 @@ const Status = {
|
||||||
},
|
},
|
||||||
muteFilterHits() {
|
muteFilterHits() {
|
||||||
return muteFilterHits(
|
return muteFilterHits(
|
||||||
Object.values(
|
Object.values(useSyncConfigStore().prefsStorage.simple.muteFilters),
|
||||||
useServerSideStorageStore().prefsStorage.simple.muteFilters,
|
|
||||||
),
|
|
||||||
this.status,
|
this.status,
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import Popover from 'src/components/popover/popover.vue'
|
||||||
import ActionButtonContainer from './action_button_container.vue'
|
import ActionButtonContainer from './action_button_container.vue'
|
||||||
import { BUTTONS } from './buttons_definitions.js'
|
import { BUTTONS } from './buttons_definitions.js'
|
||||||
|
|
||||||
import { useServerSideStorageStore } from 'src/stores/serverSideStorage.js'
|
import { useSyncConfigStore } from 'src/stores/sync_config.js'
|
||||||
|
|
||||||
import genRandomSeed from 'src/services/random_seed/random_seed.service.js'
|
import genRandomSeed from 'src/services/random_seed/random_seed.service.js'
|
||||||
|
|
||||||
|
|
@ -36,7 +36,7 @@ const StatusActionButtons = {
|
||||||
ActionButtonContainer,
|
ActionButtonContainer,
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(useServerSideStorageStore, {
|
...mapState(useSyncConfigStore, {
|
||||||
pinnedItems: (store) =>
|
pinnedItems: (store) =>
|
||||||
new Set(store.prefsStorage.collections.pinnedStatusActions),
|
new Set(store.prefsStorage.collections.pinnedStatusActions),
|
||||||
}),
|
}),
|
||||||
|
|
@ -111,18 +111,18 @@ const StatusActionButtons = {
|
||||||
return this.pinnedItems.has(button.name)
|
return this.pinnedItems.has(button.name)
|
||||||
},
|
},
|
||||||
unpin(button) {
|
unpin(button) {
|
||||||
useServerSideStorageStore().removeCollectionPreference({
|
useSyncConfigStore().removeCollectionPreference({
|
||||||
path: 'collections.pinnedStatusActions',
|
path: 'collections.pinnedStatusActions',
|
||||||
value: button.name,
|
value: button.name,
|
||||||
})
|
})
|
||||||
useServerSideStorageStore().pushServerSideStorage()
|
useSyncConfigStore().pushSyncConfig()
|
||||||
},
|
},
|
||||||
pin(button) {
|
pin(button) {
|
||||||
useServerSideStorageStore().addCollectionPreference({
|
useSyncConfigStore().addCollectionPreference({
|
||||||
path: 'collections.pinnedStatusActions',
|
path: 'collections.pinnedStatusActions',
|
||||||
value: button.name,
|
value: button.name,
|
||||||
})
|
})
|
||||||
useServerSideStorageStore().pushServerSideStorage()
|
useSyncConfigStore().pushSyncConfig()
|
||||||
},
|
},
|
||||||
getComponent(button) {
|
getComponent(button) {
|
||||||
if (!this.$store.state.users.currentUser && button.anonLink) {
|
if (!this.$store.state.users.currentUser && button.anonLink) {
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import Modal from 'src/components/modal/modal.vue'
|
import Modal from 'src/components/modal/modal.vue'
|
||||||
|
|
||||||
import { useInstanceStore } from 'src/stores/instance.js'
|
import { useInstanceStore } from 'src/stores/instance.js'
|
||||||
import { useServerSideStorageStore } from 'src/stores/serverSideStorage.js'
|
import { useSyncConfigStore } from 'src/stores/sync_config.js'
|
||||||
|
|
||||||
import pleromaTanFoxMask from 'src/assets/pleromatan_apology_fox_mask.png'
|
import pleromaTanFoxMask from 'src/assets/pleromatan_apology_fox_mask.png'
|
||||||
import pleromaTanMask from 'src/assets/pleromatan_apology_mask.png'
|
import pleromaTanMask from 'src/assets/pleromatan_apology_mask.png'
|
||||||
|
|
@ -41,9 +41,9 @@ const UpdateNotification = {
|
||||||
return (
|
return (
|
||||||
!useInstanceStore().disableUpdateNotification &&
|
!useInstanceStore().disableUpdateNotification &&
|
||||||
this.$store.state.users.currentUser &&
|
this.$store.state.users.currentUser &&
|
||||||
useServerSideStorageStore().flagStorage.updateCounter <
|
useSyncConfigStore().flagStorage.updateCounter <
|
||||||
CURRENT_UPDATE_COUNTER &&
|
CURRENT_UPDATE_COUNTER &&
|
||||||
!useServerSideStorageStore().prefsStorage.simple.dontShowUpdateNotifs
|
!useSyncConfigStore().prefsStorage.simple.dontShowUpdateNotifs
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
@ -53,22 +53,22 @@ const UpdateNotification = {
|
||||||
},
|
},
|
||||||
neverShowAgain() {
|
neverShowAgain() {
|
||||||
this.toggleShow()
|
this.toggleShow()
|
||||||
useServerSideStorageStore().setFlag({
|
useSyncConfigStore().setFlag({
|
||||||
flag: 'updateCounter',
|
flag: 'updateCounter',
|
||||||
value: CURRENT_UPDATE_COUNTER,
|
value: CURRENT_UPDATE_COUNTER,
|
||||||
})
|
})
|
||||||
useServerSideStorageStore().setPreference({
|
useSyncConfigStore().setPreference({
|
||||||
path: 'simple.dontShowUpdateNotifs',
|
path: 'simple.dontShowUpdateNotifs',
|
||||||
value: true,
|
value: true,
|
||||||
})
|
})
|
||||||
useServerSideStorageStore().pushServerSideStorage()
|
useSyncConfigStore().pushSyncConfig()
|
||||||
},
|
},
|
||||||
dismiss() {
|
dismiss() {
|
||||||
useServerSideStorageStore().setFlag({
|
useSyncConfigStore().setFlag({
|
||||||
flag: 'updateCounter',
|
flag: 'updateCounter',
|
||||||
value: CURRENT_UPDATE_COUNTER,
|
value: CURRENT_UPDATE_COUNTER,
|
||||||
})
|
})
|
||||||
useServerSideStorageStore().pushServerSideStorage()
|
useSyncConfigStore().pushSyncConfig()
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import { set } from 'lodash'
|
||||||
|
|
||||||
import messages from '../i18n/messages'
|
import messages from '../i18n/messages'
|
||||||
import localeService from '../services/locale/locale.service.js'
|
import localeService from '../services/locale/locale.service.js'
|
||||||
import { applyConfig } from '../services/style_setter/style_setter.js'
|
import { applyStyleConfig } from '../services/style_setter/style_setter.js'
|
||||||
import { defaultState, instanceDefaultConfig } from './default_config_state.js'
|
import { defaultState, instanceDefaultConfig } from './default_config_state.js'
|
||||||
|
|
||||||
import { useEmojiStore } from 'src/stores/emoji.js'
|
import { useEmojiStore } from 'src/stores/emoji.js'
|
||||||
|
|
@ -71,7 +71,7 @@ const config = {
|
||||||
mutations: {
|
mutations: {
|
||||||
setOptionTemporarily(state, { name, value }) {
|
setOptionTemporarily(state, { name, value }) {
|
||||||
set(state, name, value)
|
set(state, name, value)
|
||||||
applyConfig(state)
|
applyStyleConfig(state)
|
||||||
},
|
},
|
||||||
setOption(state, { name, value }) {
|
setOption(state, { name, value }) {
|
||||||
set(state, name, value)
|
set(state, name, value)
|
||||||
|
|
@ -162,7 +162,7 @@ const config = {
|
||||||
} else {
|
} else {
|
||||||
commit('setOption', { name, value })
|
commit('setOption', { name, value })
|
||||||
if (APPEARANCE_SETTINGS_KEYS.has(name)) {
|
if (APPEARANCE_SETTINGS_KEYS.has(name)) {
|
||||||
applyConfig(state)
|
applyStyleConfig(state)
|
||||||
}
|
}
|
||||||
if (name.startsWith('theme3hacks')) {
|
if (name.startsWith('theme3hacks')) {
|
||||||
dispatch('applyTheme', { recompile: true })
|
dispatch('applyTheme', { recompile: true })
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
const browserLocale = (window.navigator.language || 'en').split('-')[0]
|
const browserLocale = (navigator.language || 'en').split('-')[0]
|
||||||
|
|
||||||
/// Instance config entries provided by static config or pleroma api
|
/// Instance config entries provided by static config or pleroma api
|
||||||
/// Put settings here only if it does not make sense for a normal user
|
/// Put settings here only if it does not make sense for a normal user
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ import {
|
||||||
} from '../services/notification_utils/notification_utils.js'
|
} from '../services/notification_utils/notification_utils.js'
|
||||||
|
|
||||||
import { useReportsStore } from 'src/stores/reports.js'
|
import { useReportsStore } from 'src/stores/reports.js'
|
||||||
import { useServerSideStorageStore } from 'src/stores/serverSideStorage.js'
|
import { useSyncConfigStore } from 'src/stores/sync_config.js'
|
||||||
|
|
||||||
const emptyNotifications = () => ({
|
const emptyNotifications = () => ({
|
||||||
desktopNotificationSilence: true,
|
desktopNotificationSilence: true,
|
||||||
|
|
@ -119,9 +119,7 @@ export const notifications = {
|
||||||
|
|
||||||
maybeShowNotification(
|
maybeShowNotification(
|
||||||
store,
|
store,
|
||||||
Object.values(
|
Object.values(useSyncConfigStore().prefsStorage.simple.muteFilters),
|
||||||
useServerSideStorageStore().prefsStorage.simple.muteFilters,
|
|
||||||
),
|
|
||||||
notification,
|
notification,
|
||||||
)
|
)
|
||||||
} else if (notification.seen) {
|
} else if (notification.seen) {
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ import { useInstanceStore } from 'src/stores/instance.js'
|
||||||
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
||||||
import { useInterfaceStore } from 'src/stores/interface.js'
|
import { useInterfaceStore } from 'src/stores/interface.js'
|
||||||
import { useOAuthStore } from 'src/stores/oauth.js'
|
import { useOAuthStore } from 'src/stores/oauth.js'
|
||||||
import { useServerSideStorageStore } from 'src/stores/serverSideStorage'
|
import { useSyncConfigStore } from 'src/stores/sync_config.js'
|
||||||
|
|
||||||
import { declarations } from 'src/modules/config_declaration'
|
import { declarations } from 'src/modules/config_declaration'
|
||||||
|
|
||||||
|
|
@ -682,7 +682,7 @@ const users = {
|
||||||
useInterfaceStore().setLastTimeline('public-timeline')
|
useInterfaceStore().setLastTimeline('public-timeline')
|
||||||
useInterfaceStore().setLayoutWidth(windowWidth())
|
useInterfaceStore().setLayoutWidth(windowWidth())
|
||||||
useInterfaceStore().setLayoutHeight(windowHeight())
|
useInterfaceStore().setLayoutHeight(windowHeight())
|
||||||
store.commit('clearServerSideStorage')
|
//useSyncConfigStore().clearSyncConfig()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
loginUser(store, accessToken) {
|
loginUser(store, accessToken) {
|
||||||
|
|
@ -702,7 +702,7 @@ const users = {
|
||||||
user.domainMutes = []
|
user.domainMutes = []
|
||||||
commit('setCurrentUser', user)
|
commit('setCurrentUser', user)
|
||||||
|
|
||||||
useServerSideStorageStore().setServerSideStorage(user)
|
useSyncConfigStore().setSyncConfig(user)
|
||||||
commit('addNewUsers', [user])
|
commit('addNewUsers', [user])
|
||||||
|
|
||||||
useEmojiStore().fetchEmoji()
|
useEmojiStore().fetchEmoji()
|
||||||
|
|
@ -723,17 +723,16 @@ const users = {
|
||||||
/*
|
/*
|
||||||
// Reset wordfilter
|
// Reset wordfilter
|
||||||
Object.keys(
|
Object.keys(
|
||||||
useServerSideStorageStore().prefsStorage.simple.muteFilters
|
useSyncConfigStore().prefsStorage.simple.muteFilters
|
||||||
).forEach(key => {
|
).forEach(key => {
|
||||||
useServerSideStorageStore().unsetPreference({ path: 'simple.muteFilters.' + key, value: null })
|
useSyncConfigStore().unsetPreference({ path: 'simple.muteFilters.' + key, value: null })
|
||||||
})
|
})
|
||||||
|
|
||||||
// Reset flag to 0 to re-run migrations
|
// Reset flag to 0 to re-run migrations
|
||||||
useServerSideStorageStore().setFlag({ flag: 'configMigration', value: 0 })
|
useSyncConfigStore().setFlag({ flag: 'configMigration', value: 0 })
|
||||||
/**/
|
/**/
|
||||||
|
|
||||||
const { configMigration } =
|
const { configMigration } = useSyncConfigStore().flagStorage
|
||||||
useServerSideStorageStore().flagStorage
|
|
||||||
declarations
|
declarations
|
||||||
.filter((x) => {
|
.filter((x) => {
|
||||||
return (
|
return (
|
||||||
|
|
@ -744,12 +743,12 @@ const users = {
|
||||||
})
|
})
|
||||||
.toSorted((a, b) => a.configMigration - b.configMigration)
|
.toSorted((a, b) => a.configMigration - b.configMigration)
|
||||||
.forEach((value) => {
|
.forEach((value) => {
|
||||||
value.migration(useServerSideStorageStore(), store.rootState)
|
value.migration(useSyncConfigStore(), store.rootState)
|
||||||
useServerSideStorageStore().setFlag({
|
useSyncConfigStore().setFlag({
|
||||||
flag: 'configMigration',
|
flag: 'configMigration',
|
||||||
value: value.migrationNum,
|
value: value.migrationNum,
|
||||||
})
|
})
|
||||||
useServerSideStorageStore().pushServerSideStorage()
|
useSyncConfigStore().pushSyncConfig()
|
||||||
})
|
})
|
||||||
|
|
||||||
if (user.token) {
|
if (user.token) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue