Migrate interface module to store
This commit is contained in:
parent
872569ae8e
commit
b1dcea0199
33 changed files with 244 additions and 77 deletions
|
|
@ -3,6 +3,7 @@ import { WSConnectionStatus } from '../services/api/api.service.js'
|
|||
import { maybeShowChatNotification } from '../services/chat_utils/chat_utils.js'
|
||||
import { Socket } from 'phoenix'
|
||||
import { useShoutStore } from '../stores/shout.js'
|
||||
import { useInterfaceStore } from '../stores/interface.js'
|
||||
|
||||
const retryTimeout = (multiplier) => 1000 * multiplier
|
||||
|
||||
|
|
@ -132,7 +133,7 @@ const api = {
|
|||
state.mastoUserSocket.addEventListener('open', () => {
|
||||
// Do not show notification when we just opened up the page
|
||||
if (state.mastoUserSocketStatus !== WSConnectionStatus.STARTING_INITIAL) {
|
||||
dispatch('pushGlobalNotice', {
|
||||
useInterfaceStore().pushGlobalNotice({
|
||||
level: 'success',
|
||||
messageKey: 'timeline.socket_reconnected',
|
||||
timeout: 5000
|
||||
|
|
@ -174,7 +175,7 @@ const api = {
|
|||
dispatch('startFetchingTimeline', { timeline: 'friends' })
|
||||
dispatch('startFetchingNotifications')
|
||||
dispatch('startFetchingChats')
|
||||
dispatch('pushGlobalNotice', {
|
||||
useInterfaceStore().pushGlobalNotice({
|
||||
level: 'error',
|
||||
messageKey: 'timeline.socket_broke',
|
||||
messageArgs: [code],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue