Merge branch 'release/2.1.0' into develop

pull/2507/head
Chocobozzz 2020-02-17 15:34:42 +01:00
commit 2ad9dcda24
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
4 changed files with 14 additions and 5 deletions

View File

@ -168,8 +168,11 @@ export class ServerService {
if (!this.configObservable) {
this.configObservable = this.http.get<ServerConfig>(ServerService.BASE_CONFIG_URL)
.pipe(
tap(this.saveConfigLocally),
tap(() => this.configLoaded = true),
tap(config => this.saveConfigLocally(config)),
tap(config => {
this.config = config
this.configLoaded = true
}),
tap(() => {
if (this.configReset) {
this.configReloaded.next()

View File

@ -141,6 +141,8 @@ export class VideoPlaylistService {
return this.authHttp.post<{ videoPlaylist: { id: number } }>(VideoPlaylistService.BASE_VIDEO_PLAYLIST_URL, data)
.pipe(
tap(res => {
if (!this.myAccountPlaylistCache) return
this.myAccountPlaylistCache.total++
this.myAccountPlaylistCache.data.push({
@ -161,6 +163,8 @@ export class VideoPlaylistService {
.pipe(
map(this.restExtractor.extractDataBool),
tap(() => {
if (!this.myAccountPlaylistCache) return
const playlist = this.myAccountPlaylistCache.data.find(p => p.id === videoPlaylist.id)
playlist.displayName = body.displayName
@ -175,6 +179,8 @@ export class VideoPlaylistService {
.pipe(
map(this.restExtractor.extractDataBool),
tap(() => {
if (!this.myAccountPlaylistCache) return
this.myAccountPlaylistCache.total--
this.myAccountPlaylistCache.data = this.myAccountPlaylistCache.data
.filter(p => p.id !== videoPlaylist.id)

View File

@ -176,8 +176,8 @@ async function updateActorAvatarInstance (actor: MActorDefault, info: AvatarInfo
if (!info.name) return actor
if (actor.Avatar) {
// Don't update the avatar if the filename did not change
if (actor.Avatar.fileUrl === info.fileUrl) return actor
// Don't update the avatar if the file URL did not change
if (info.fileUrl && actor.Avatar.fileUrl === info.fileUrl) return actor
try {
await actor.Avatar.destroy({ transaction: t })

View File

@ -59,7 +59,7 @@ async function processFollow (byActor: MActorSignature, targetActorURL: string)
transaction: t
})
if (actorFollow.state !== 'accepted' && CONFIG.FOLLOWERS.INSTANCE.MANUAL_APPROVAL === false) {
if (actorFollow.state !== 'accepted' && isFollowingInstance && CONFIG.FOLLOWERS.INSTANCE.MANUAL_APPROVAL === false) {
actorFollow.state = 'accepted'
await actorFollow.save({ transaction: t })
}