mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
add state strings for subplebbit pages
This commit is contained in:
@@ -29,6 +29,26 @@ const useStateString = (commentOrSubplebbit) => {
|
||||
}
|
||||
}
|
||||
|
||||
// find subplebbit pages states
|
||||
if (commentOrSubplebbit?.posts?.clients) {
|
||||
for (const clientType in commentOrSubplebbit.posts.clients) {
|
||||
for (const sortType in commentOrSubplebbit.posts.clients[clientType]) {
|
||||
for (const clientUrl in commentOrSubplebbit.posts.clients[clientType][sortType]) {
|
||||
let state = commentOrSubplebbit.posts.clients[clientType][sortType][clientUrl].state
|
||||
if (state === 'stopped') {
|
||||
continue
|
||||
}
|
||||
state += `-page-${sortType}`
|
||||
console.log(clientType, sortType, clientUrl, state)
|
||||
if (!states[state]) {
|
||||
states[state] = []
|
||||
}
|
||||
states[state].push(clientUrl)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const getClientHost = (clientUrl) => {
|
||||
try {
|
||||
clientUrl = new URL(clientUrl).hostname || clientUrl
|
||||
|
||||
Reference in New Issue
Block a user