Compare commits
20 Commits
snoot
...
feature/pl
Author | SHA1 | Date |
---|---|---|
Roger Braun | 9c68acaa48 | |
Roger Braun | 43320cff9d | |
Roger Braun | d3d58c25e7 | |
Roger Braun | 5ce010cacf | |
Roger Braun | 496bca9e7a | |
Roger Braun | c7e477ebb6 | |
Roger Braun | 22469d80e7 | |
Roger Braun | f74ca19d14 | |
Roger Braun | fd4468a57f | |
Roger Braun | e874e2dc7d | |
Roger Braun | 444513694a | |
Roger Braun | f18445967f | |
Roger Braun | 93d6f424a0 | |
Roger Braun | 05ff878467 | |
Roger Braun | 00b884ae0b | |
Roger Braun | 21f7e8e1f0 | |
Roger Braun | a26debded1 | |
Roger Braun | 0265e83e06 | |
Roger Braun | a0d258f75b | |
Roger Braun | 3c20069902 |
|
@ -23,7 +23,7 @@ module.exports = {
|
|||
assetsPublicPath: '/',
|
||||
proxyTable: {
|
||||
'/api': {
|
||||
target: 'https://social.heldscal.la/',
|
||||
target: 'https://pleroma.soykaf.com/',
|
||||
changeOrigin: true,
|
||||
cookieDomainRewrite: 'localhost'
|
||||
}
|
||||
|
|
|
@ -51,6 +51,9 @@ export default function createPersistedState ({
|
|||
merge({}, store.state, savedState)
|
||||
)
|
||||
}
|
||||
if (store.state.users.lastLoginName) {
|
||||
store.dispatch('loginUser', {username: store.state.users.lastLoginName, password: 'xxx'})
|
||||
}
|
||||
loaded = true
|
||||
} catch (e) {
|
||||
console.log("Couldn't load state")
|
||||
|
|
|
@ -38,8 +38,7 @@ const persistedStateOptions = {
|
|||
'config.autoLoad',
|
||||
'config.hoverPreview',
|
||||
'config.muteWords',
|
||||
'statuses.notifications',
|
||||
'users.users'
|
||||
'users.lastLoginName'
|
||||
]
|
||||
}
|
||||
|
||||
|
|
|
@ -24,10 +24,12 @@ export const mutations = {
|
|||
set(user, 'muted', muted)
|
||||
},
|
||||
setCurrentUser (state, user) {
|
||||
state.lastLoginName = user.screen_name
|
||||
state.currentUser = merge(state.currentUser || {}, user)
|
||||
},
|
||||
clearCurrentUser (state) {
|
||||
state.currentUser = false
|
||||
state.lastLoginName = false
|
||||
},
|
||||
beginLogin (state) {
|
||||
state.loggingIn = true
|
||||
|
@ -44,6 +46,7 @@ export const mutations = {
|
|||
}
|
||||
|
||||
export const defaultState = {
|
||||
lastLoginName: false,
|
||||
currentUser: false,
|
||||
loggingIn: false,
|
||||
users: [],
|
||||
|
|
|
@ -24,6 +24,7 @@ const BANNER_UPDATE_URL = '/api/account/update_profile_banner.json'
|
|||
const PROFILE_UPDATE_URL = '/api/account/update_profile.json'
|
||||
const EXTERNAL_PROFILE_URL = '/api/externalprofile/show.json'
|
||||
const QVITTER_USER_TIMELINE_URL = '/api/qvitter/statuses/user_timeline.json'
|
||||
const MRN_URL = '/api/account/most_recent_notification.json'
|
||||
// const USER_URL = '/api/users/show.json'
|
||||
|
||||
import { each, map } from 'lodash'
|
||||
|
@ -34,6 +35,7 @@ const oldfetch = window.fetch
|
|||
let fetch = (url, options) => {
|
||||
const baseUrl = ''
|
||||
const fullUrl = baseUrl + url
|
||||
options.credentials = 'include'
|
||||
return oldfetch(fullUrl, options)
|
||||
}
|
||||
|
||||
|
@ -179,6 +181,14 @@ const unfollowUser = ({id, credentials}) => {
|
|||
}).then((data) => data.json())
|
||||
}
|
||||
|
||||
const updateMRN = ({id, credentials}) => {
|
||||
let url = `${MRN_URL}?id=${id}`
|
||||
return fetch(url, {
|
||||
headers: authHeaders(credentials),
|
||||
method: 'POST'
|
||||
}).then((data) => data.json())
|
||||
}
|
||||
|
||||
const fetchFriends = ({credentials}) => {
|
||||
return fetch(FRIENDS_URL, { headers: authHeaders(credentials) })
|
||||
.then((data) => data.json())
|
||||
|
@ -337,12 +347,13 @@ const apiService = {
|
|||
fetchAllFollowing,
|
||||
setUserMute,
|
||||
fetchMutes,
|
||||
externalProfile,
|
||||
register,
|
||||
updateAvatar,
|
||||
updateMRN,
|
||||
updateBg,
|
||||
updateProfile,
|
||||
updateBanner,
|
||||
externalProfile
|
||||
updateBanner
|
||||
}
|
||||
|
||||
export default apiService
|
||||
|
|
|
@ -43,6 +43,7 @@ const backendInteractorService = (credentials) => {
|
|||
const updateProfile = ({params}) => apiService.updateProfile({credentials, params})
|
||||
|
||||
const externalProfile = (profileUrl) => apiService.externalProfile(profileUrl)
|
||||
const updateMRN = ({id}) => apiService.updateMRN({credentials, id})
|
||||
|
||||
const backendInteractorServiceInstance = {
|
||||
fetchStatus,
|
||||
|
@ -55,12 +56,13 @@ const backendInteractorService = (credentials) => {
|
|||
startFetching,
|
||||
setUserMute,
|
||||
fetchMutes,
|
||||
externalProfile,
|
||||
register,
|
||||
updateMRN,
|
||||
updateAvatar,
|
||||
updateBg,
|
||||
updateBanner,
|
||||
updateProfile,
|
||||
externalProfile
|
||||
updateProfile
|
||||
}
|
||||
|
||||
return backendInteractorServiceInstance
|
||||
|
|
Loading…
Reference in New Issue