aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--client/src/app/core/server/server.service.ts7
-rw-r--r--client/src/app/shared/video-playlist/video-playlist.service.ts6
-rw-r--r--server/lib/activitypub/actor.ts4
-rw-r--r--server/lib/activitypub/process/process-follow.ts2
4 files changed, 14 insertions, 5 deletions
diff --git a/client/src/app/core/server/server.service.ts b/client/src/app/core/server/server.service.ts
index c0e1f08bb..e015d0e14 100644
--- a/client/src/app/core/server/server.service.ts
+++ b/client/src/app/core/server/server.service.ts
@@ -168,8 +168,11 @@ export class ServerService {
168 if (!this.configObservable) { 168 if (!this.configObservable) {
169 this.configObservable = this.http.get<ServerConfig>(ServerService.BASE_CONFIG_URL) 169 this.configObservable = this.http.get<ServerConfig>(ServerService.BASE_CONFIG_URL)
170 .pipe( 170 .pipe(
171 tap(this.saveConfigLocally), 171 tap(config => this.saveConfigLocally(config)),
172 tap(() => this.configLoaded = true), 172 tap(config => {
173 this.config = config
174 this.configLoaded = true
175 }),
173 tap(() => { 176 tap(() => {
174 if (this.configReset) { 177 if (this.configReset) {
175 this.configReloaded.next() 178 this.configReloaded.next()
diff --git a/client/src/app/shared/video-playlist/video-playlist.service.ts b/client/src/app/shared/video-playlist/video-playlist.service.ts
index bae6f9e04..38d915c6b 100644
--- a/client/src/app/shared/video-playlist/video-playlist.service.ts
+++ b/client/src/app/shared/video-playlist/video-playlist.service.ts
@@ -141,6 +141,8 @@ export class VideoPlaylistService {
141 return this.authHttp.post<{ videoPlaylist: { id: number } }>(VideoPlaylistService.BASE_VIDEO_PLAYLIST_URL, data) 141 return this.authHttp.post<{ videoPlaylist: { id: number } }>(VideoPlaylistService.BASE_VIDEO_PLAYLIST_URL, data)
142 .pipe( 142 .pipe(
143 tap(res => { 143 tap(res => {
144 if (!this.myAccountPlaylistCache) return
145
144 this.myAccountPlaylistCache.total++ 146 this.myAccountPlaylistCache.total++
145 147
146 this.myAccountPlaylistCache.data.push({ 148 this.myAccountPlaylistCache.data.push({
@@ -161,6 +163,8 @@ export class VideoPlaylistService {
161 .pipe( 163 .pipe(
162 map(this.restExtractor.extractDataBool), 164 map(this.restExtractor.extractDataBool),
163 tap(() => { 165 tap(() => {
166 if (!this.myAccountPlaylistCache) return
167
164 const playlist = this.myAccountPlaylistCache.data.find(p => p.id === videoPlaylist.id) 168 const playlist = this.myAccountPlaylistCache.data.find(p => p.id === videoPlaylist.id)
165 playlist.displayName = body.displayName 169 playlist.displayName = body.displayName
166 170
@@ -175,6 +179,8 @@ export class VideoPlaylistService {
175 .pipe( 179 .pipe(
176 map(this.restExtractor.extractDataBool), 180 map(this.restExtractor.extractDataBool),
177 tap(() => { 181 tap(() => {
182 if (!this.myAccountPlaylistCache) return
183
178 this.myAccountPlaylistCache.total-- 184 this.myAccountPlaylistCache.total--
179 this.myAccountPlaylistCache.data = this.myAccountPlaylistCache.data 185 this.myAccountPlaylistCache.data = this.myAccountPlaylistCache.data
180 .filter(p => p.id !== videoPlaylist.id) 186 .filter(p => p.id !== videoPlaylist.id)
diff --git a/server/lib/activitypub/actor.ts b/server/lib/activitypub/actor.ts
index fd934443b..9eabef4b0 100644
--- a/server/lib/activitypub/actor.ts
+++ b/server/lib/activitypub/actor.ts
@@ -176,8 +176,8 @@ async function updateActorAvatarInstance (actor: MActorDefault, info: AvatarInfo
176 if (!info.name) return actor 176 if (!info.name) return actor
177 177
178 if (actor.Avatar) { 178 if (actor.Avatar) {
179 // Don't update the avatar if the filename did not change 179 // Don't update the avatar if the file URL did not change
180 if (actor.Avatar.fileUrl === info.fileUrl) return actor 180 if (info.fileUrl && actor.Avatar.fileUrl === info.fileUrl) return actor
181 181
182 try { 182 try {
183 await actor.Avatar.destroy({ transaction: t }) 183 await actor.Avatar.destroy({ transaction: t })
diff --git a/server/lib/activitypub/process/process-follow.ts b/server/lib/activitypub/process/process-follow.ts
index 85f22d654..0b98d4af2 100644
--- a/server/lib/activitypub/process/process-follow.ts
+++ b/server/lib/activitypub/process/process-follow.ts
@@ -59,7 +59,7 @@ async function processFollow (byActor: MActorSignature, targetActorURL: string)
59 transaction: t 59 transaction: t
60 }) 60 })
61 61
62 if (actorFollow.state !== 'accepted' && CONFIG.FOLLOWERS.INSTANCE.MANUAL_APPROVAL === false) { 62 if (actorFollow.state !== 'accepted' && isFollowingInstance && CONFIG.FOLLOWERS.INSTANCE.MANUAL_APPROVAL === false) {
63 actorFollow.state = 'accepted' 63 actorFollow.state = 'accepted'
64 await actorFollow.save({ transaction: t }) 64 await actorFollow.save({ transaction: t })
65 } 65 }