refactor promisedRequest to always return whole response
This commit is contained in:
parent
c81813064b
commit
1ca0ffb1f0
25 changed files with 352 additions and 327 deletions
|
|
@ -1,4 +1,3 @@
|
|||
import { fetchTimeline } from 'src/api/public.js'
|
||||
import { promiseInterval } from '../promise_interval/promise_interval.js'
|
||||
|
||||
import { useInstanceStore } from 'src/stores/instance.js'
|
||||
|
|
@ -6,6 +5,8 @@ import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.j
|
|||
import { useInterfaceStore } from 'src/stores/interface.js'
|
||||
import { useMergedConfigStore } from 'src/stores/merged_config.js'
|
||||
|
||||
import { fetchTimeline } from 'src/api/public.js'
|
||||
|
||||
const update = ({ store, notifications, older }) => {
|
||||
store.dispatch('addNewNotifications', { notifications, older })
|
||||
}
|
||||
|
|
@ -97,6 +98,7 @@ const fetchNotifications = ({ store, args, older }) => {
|
|||
throw new Error(`${response.status} ${response.statusText}`)
|
||||
}
|
||||
}
|
||||
|
||||
const notifications = response.data
|
||||
update({ store, notifications, older })
|
||||
return notifications
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue