akkoma-fe/src/modules/instance.js
Henry Jameson 51cf4dc298 Merge remote-tracking branch 'upstream/develop' into feature/theming2
* upstream/develop:
  Fix iOS Safari from making videos play fullscreen by default
  added PR comments
  resolved the lint
  used the deleted data param as condition in status template
  Switch to "timeline" when pressing user-settings
  Added user setting tooltip
  made links in user bio always open in new tabs
  addressed PR comments
  added tooltip
  Add userId property to timelines so that we don't overwrite user timeline meant for another user
  Added option to auto-hide subject field when it's empty.
  removes hacks from notifications storage, adds api call to let server update is_seen attribute
  fixes vimium not giving retweet button a hint
  Do not use underscore at the beginning of the method
  Logout user on password change
  Route user to the correct profile URL
  Typo
  Fix filetype detection
  Switch to settings when touching settings
  Switch to timeline on nav panel actions
2018-12-05 10:43:03 +03:00

70 lines
1.6 KiB
JavaScript

import { set } from 'vue'
import { setPreset } from '../services/style_setter/style_setter.js'
const defaultState = {
// Stuff from static/config.json and apiConfig
name: 'Pleroma FE',
registrationOpen: true,
textlimit: 5000,
server: 'http://localhost:4040/',
theme: 'pleroma-dark',
background: '/static/aurora_borealis.jpg',
logo: '/static/logo.png',
logoMask: true,
logoMargin: '.2em',
redirectRootNoLogin: '/main/all',
redirectRootLogin: '/main/friends',
showInstanceSpecificPanel: false,
scopeOptionsEnabled: true,
formattingOptionsEnabled: false,
alwaysShowSubjectInput: true,
collapseMessageWithSubject: false,
hidePostStats: false,
hideUserStats: false,
disableChat: false,
scopeCopy: true,
subjectLineBehavior: 'email',
loginMethod: 'password',
// Nasty stuff
pleromaBackend: true,
emoji: [],
customEmoji: [],
// Feature-set, apparently, not everything here is reported...
mediaProxyAvailable: false,
chatAvailable: false,
gopherAvailable: false,
suggestionsEnabled: false,
suggestionsWeb: '',
// Html stuff
instanceSpecificPanelContent: '',
tos: ''
}
const instance = {
state: defaultState,
mutations: {
setInstanceOption (state, { name, value }) {
if (typeof value !== 'undefined') {
set(state, name, value)
}
}
},
actions: {
setInstanceOption ({ commit, dispatch }, { name, value }) {
commit('setInstanceOption', {name, value})
switch (name) {
case 'name':
dispatch('setPageTitle')
break
case 'theme':
setPreset(value, commit)
}
}
}
}
export default instance