mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 09:17:30 +08:00
FIX: Read FAQ wasn't working with a URL on the same site
This commit is contained in:
parent
11939fa8b9
commit
86c970bac0
|
@ -4,7 +4,7 @@ import DiscourseURL from 'discourse/lib/url';
|
|||
import { ajax } from 'discourse/lib/ajax';
|
||||
|
||||
createWidget('priority-faq-link', {
|
||||
tagName: 'a.faq-priority',
|
||||
tagName: 'a.faq-priority.widget-link',
|
||||
|
||||
buildAttributes(attrs) {
|
||||
return { href: attrs.href };
|
||||
|
@ -15,12 +15,14 @@ createWidget('priority-faq-link', {
|
|||
},
|
||||
|
||||
click(e) {
|
||||
if (this.siteSettings.faq_url === this.attrs.href) {
|
||||
e.preventDefault();
|
||||
if (this.siteSettings.faq_url === this.attrs.href) {
|
||||
ajax("/users/read-faq", { method: "POST" }).then(() => {
|
||||
this.currentUser.set('read_faq', true);
|
||||
return DiscourseURL.routeToTag($(e.target).closest('a')[0]);
|
||||
DiscourseURL.routeToTag($(e.target).closest('a')[0]);
|
||||
});
|
||||
} else {
|
||||
DiscourseURL.routeToTag($(e.target).closest('a')[0]);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue
Block a user