webuild-community / federated-blog

A federated blog platform built for WeBuild Community
https://read.webuild.community/
58 stars 34 forks source link

Fix redirect to homepage in read page #89

Open huyng12 opened 3 years ago

huyng12 commented 3 years ago

Fix #83

huy-qn commented 3 years ago

Cái fix này bỏ luôn chức năng của nút back.

Mình nghĩ để cái lịnk back to home ở cái logo (nhấn vô logo thì mới về trang chủ), còn thay typo cái nút "quay về trang chủ" trong bài gửi bằng 1 cái "icon" back thôi. Hoặc là bỏ luôn đi, dùng navigation của browsers/device cho tiện.

huyng12 commented 3 years ago

Cái fix này bỏ luôn chức năng của nút back.

Mình nghĩ để cái lịnk back to home ở cái logo (nhấn vô logo thì mới về trang chủ), còn thay typo cái nút "quay về trang chủ" trong bài gửi bằng 1 cái "icon" back thôi. Hoặc là bỏ luôn đi, dùng navigation của browsers/device cho tiện.

Mình nghĩ là bạn đang so sánh changes của mình với code gốc, nếu như xét về ngữ nghĩa của "Quay về trang chủ" thì fix của mình bỏ đi những dòng code "thừa" (và không đúng).

huytd commented 3 years ago

Please check this comment about the different use cases of back and push('/') https://github.com/webuild-community/federated-blog/pull/27/files#r659125981

huy-qn commented 3 years ago

Please check this comment about the different use cases of back and push('/') https://github.com/webuild-community/federated-blog/pull/27/files#r659125981

This doesn't work quite well with the "read a random article" feature. For users who read random articles continuously, these articles get pushed into the history queue, so the "back to home" button doesn't work as it say in this case, hence the issue happened here.

huytd commented 3 years ago

We can add some query param to indicate that the user is in random read mode, I think