akkoma-fe/src/modules/instance.js
Henry Jameson e06717fd0d Merge remote-tracking branch 'upstream/develop' into feature/scope_preferences
* upstream/develop:
  DM timeline: stream new statuses
  update-japanese-translation
  Add actual user search.
  incorporate most translation changes from MR 368
  update french translation
  Always show dm panel.
  Add direct message tab.
  api service url
  On logout switch to public timeline.
  Put oauth text into description.
  Display OAuth login on login form button.
  Add login form back in.
  Linting.
  Re-activate registration, use oauth password flow to fetch token.
  Fix typo.
  Remove gonsole.logg :DD
  Fix linting.
  Move login to oauth.
2018-11-26 04:38:44 +03:00

69 lines
1.6 KiB
JavaScript

import { set } from 'vue'
import StyleSetter 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,
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':
StyleSetter.setPreset(value, commit)
}
}
}
}
export default instance