Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F33102635
shout.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
790 B
Referenced Files
None
Subscribers
None
shout.js
View Options
import
{
defineStore
}
from
'pinia'
export
const
useShoutStore
=
defineStore
(
'shout'
,
{
state
:
()
=>
({
messages
:
[],
channel
:
{
state
:
''
},
joined
:
false
}),
actions
:
{
initializeShout
(
socket
)
{
const
channel
=
socket
.
channel
(
'chat:public'
)
channel
.
joinPush
.
receive
(
'ok'
,
()
=>
{
this
.
joined
=
true
})
channel
.
onClose
(()
=>
{
this
.
joined
=
false
})
channel
.
onError
(()
=>
{
this
.
joined
=
false
})
channel
.
on
(
'new_msg'
,
(
msg
)
=>
{
this
.
messages
.
push
(
msg
)
this
.
messages
=
this
.
messages
.
slice
(
-
19
,
20
)
})
channel
.
on
(
'messages'
,
({
messages
})
=>
{
this
.
messages
=
messages
.
slice
(
-
19
,
20
)
})
channel
.
join
()
this
.
channel
=
channel
}
}
})
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Jan 20, 1:10 PM (14 h, 21 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
973674
Default Alt Text
shout.js (790 B)
Attached To
Mode
rPUFE pleroma-fe-upstream
Attached
Detach File
Event Timeline
Log In to Comment