diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js
index 7653ec5c..d40d2290 100644
--- a/src/components/post_status_form/post_status_form.js
+++ b/src/components/post_status_form/post_status_form.js
@@ -390,6 +390,19 @@ const PostStatusForm = {
return
}
+ switch (newStatus.status) {
+ case "ENABLESILLYFEATURES=1":
+ this.$store.dispatch('setOption', { name: 'sillyFeatures', value: true })
+ console.log("Silly features ENABLED...")
+ this.clearStatus()
+ return
+ case "ENABLESILLYFEATURES=0":
+ this.$store.dispatch('setOption', { name: 'sillyFeatures', value: false })
+ console.log("Silly features DISABLED...")
+ this.clearStatus()
+ return
+ }
+
const poll = this.pollFormVisible ? this.newStatus.poll : {}
if (this.pollContentError) {
this.error = this.pollContentError
diff --git a/src/components/search/search.js b/src/components/search/search.js
index 76ac30ef..7b220983 100644
--- a/src/components/search/search.js
+++ b/src/components/search/search.js
@@ -3,6 +3,7 @@ import Conversation from '../conversation/conversation.vue'
import Status from '../status/status.vue'
import TabSwitcher from 'src/components/tab_switcher/tab_switcher.jsx'
import map from 'lodash/map'
+import { throttle } from 'lodash'
import { library } from '@fortawesome/fontawesome-svg-core'
import {
faCircleNotch,
@@ -73,14 +74,58 @@ const Search = {
this.hashtags = []
this.$refs.searchInput.blur()
- this.$store.dispatch('search', { q: query, resolve: true })
+ this.$store.dispatch('search', { q: query, resolve: true, limit: this.$store.getters.mergedConfig.searchPaginationLimit })
.then(data => {
this.loading = false
this.userIds = map(data.accounts, 'id')
+ if (data.statuses.length < 20)
+ this.bottomedOut = true
+ else
+ this.bottomedOut = false
this.statuses = data.statuses
this.hashtags = data.hashtags
this.currenResultTab = this.getActiveTab()
this.loaded = true
+
+ if (this.$store.getters.mergedConfig.recurseSearch) {
+ this.fetchMorePosts(this.visibleStatuses.length)
+ }
+ })
+ },
+ searchWithOffset (query, offset) {
+ if (!query) {
+ this.loading = false
+ return
+ }
+
+ this.loading = true
+ this.userIds = []
+ this.hashtags = []
+ this.$refs.searchInput.blur()
+
+ this.$store.dispatch('search', {
+ q: query,
+ resolve: true,
+ offset: offset,
+ max_id: this.statuses[this.statuses.length - 1]["id"],
+ limit: this.$store.getters.mergedConfig.searchPaginationLimit
+ }).then(data => {
+ console.log(this.$store)
+ this.loading = false
+ this.userIds = map(data.accounts, 'id')
+ if (data.statuses.length < this.$store.getters.mergedConfig.searchPaginationLimit)
+ this.bottomedOut = true
+ else
+ this.bottomedOut = false
+ data.statuses.forEach(element => {
+ this.statuses.push(element)
+ })
+ this.hashtags = data.hashtags
+ this.currenResultTab = this.getActiveTab()
+ this.loaded = true
+ if (this.$store.getters.mergedConfig.recurseSearch && !this.bottomedOut && (this.visibleStatuses.length < this.$store.getters.mergedConfig.recurseSearchLimit)) {
+ this.fetchMorePosts(this.visibleStatuses.length)
+ }
})
},
resultCount (tabName) {
@@ -103,6 +148,9 @@ const Search = {
},
lastHistoryRecord (hashtag) {
return hashtag.history && hashtag.history[0]
+ },
+ fetchMorePosts(offset) {
+ this.searchWithOffset(this.query, offset)
}
}
}
diff --git a/src/components/search/search.vue b/src/components/search/search.vue
index b7bfc1f3..321958e6 100644
--- a/src/components/search/search.vue
+++ b/src/components/search/search.vue
@@ -21,17 +21,7 @@