File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -324,6 +324,10 @@ private extension WriteFreelyModel {
324
324
}
325
325
326
326
func publishHandler( result: Result < WFPost , Error > ) {
327
+ // ⚠️ NOTE:
328
+ // The API does not return a collection alias, so we take care not to overwrite the
329
+ // cached post's collection alias with the 'nil' value from the fetched post.
330
+ // See: https://github.com/writeas/writefreely-swift/issues/20
327
331
do {
328
332
let fetchedPost = try result. get ( )
329
333
let foundPostIndex = posts. userPosts. firstIndex ( where: {
@@ -333,7 +337,6 @@ private extension WriteFreelyModel {
333
337
let cachedPost = self . posts. userPosts [ index]
334
338
cachedPost. appearance = fetchedPost. appearance
335
339
cachedPost. body = fetchedPost. body
336
- cachedPost. collectionAlias = fetchedPost. collectionAlias
337
340
cachedPost. createdDate = fetchedPost. createdDate
338
341
cachedPost. language = fetchedPost. language
339
342
cachedPost. postId = fetchedPost. postId
You can’t perform that action at this time.
0 commit comments