]> Untitled Git - lemmy.git/commitdiff
Add sort fields to rss.
authorDessalines <tyhou13@gmx.com>
Mon, 2 Dec 2019 06:20:01 +0000 (22:20 -0800)
committerDessalines <tyhou13@gmx.com>
Mon, 2 Dec 2019 06:22:05 +0000 (22:22 -0800)
- #348

ui/src/components/community.tsx
ui/src/components/main.tsx
ui/src/components/user.tsx

index a8ec9331abd8f11af89e8c71d497f56a2ab96829..712aeb7e582f3e5b1cb99cfefcdd23361ff5de00 100644 (file)
@@ -175,7 +175,10 @@ export class Community extends Component<any, State> {
       <div class="mb-2">
         <SortSelect sort={this.state.sort} onChange={this.handleSortChange} />
         <a
-          href={`${document.location.origin}/feeds/c/${this.state.communityName}.xml`}
+          href={`/feeds/c/${this.state.communityName}.xml?sort=${
+            SortType[this.state.sort]
+          }`}
+          target="_blank"
         >
           <svg class="icon mx-2 text-muted small">
             <use xlinkHref="#icon-rss">#</use>
index 403368ab7aee045e44c0fcc087abf0620f67e32a..f4ec779fc2ba03666c0b5e528ef91dd05c3f6db2 100644 (file)
@@ -435,7 +435,10 @@ export class Main extends Component<any, MainState> {
           <SortSelect sort={this.state.sort} onChange={this.handleSortChange} />
         </span>
         {this.state.type_ == ListingType.All && (
-          <a href={`${document.location.origin}/feeds/all.xml`}>
+          <a
+            href={`/feeds/all.xml?sort=${SortType[this.state.sort]}`}
+            target="_blank"
+          >
             <svg class="icon mx-1 text-muted small">
               <use xlinkHref="#icon-rss">#</use>
             </svg>
index 6fff538fa741499916ec70514ad35a4f11cf5734..b90f8167d81d51be06482239ae2e4e3893bfa96b 100644 (file)
@@ -250,7 +250,10 @@ export class User extends Component<any, UserState> {
           />
         </span>
         <a
-          href={`${document.location.origin}/feeds/u/${this.state.username}.xml`}
+          href={`/feeds/u/${this.state.username}.xml?sort=${
+            SortType[this.state.sort]
+          }`}
+          target="_blank"
         >
           <svg class="icon mx-2 text-muted small">
             <use xlinkHref="#icon-rss">#</use>