Add openWorkers deep-link query for worker modal parity (Phase 687).
Parse ?workers=1 and integration-workers on guild-channel deep links so onboarding and settings can open the integration worker registry modal. Co-authored-by: Cursor <[email protected]>
This commit is contained in:
+15
-1
@@ -127,6 +127,7 @@ function parsePearcordDeepLink (url) {
|
||||
const openBots = parseOpenBotsQuery(m[3] || '')
|
||||
const openWebhooks = parseOpenWebhooksQuery(m[3] || '')
|
||||
const openAutomation = parseOpenAutomationQuery(m[3] || '')
|
||||
const openWorkers = parseOpenWorkersQuery(m[3] || '')
|
||||
return {
|
||||
kind: 'guild-channel',
|
||||
guildId: m[1],
|
||||
@@ -139,7 +140,8 @@ function parsePearcordDeepLink (url) {
|
||||
openSlashCommands,
|
||||
openBots,
|
||||
openWebhooks,
|
||||
openAutomation
|
||||
openAutomation,
|
||||
openWorkers
|
||||
}
|
||||
}
|
||||
m = GUILD_ONLY.exec(s)
|
||||
@@ -241,6 +243,18 @@ function parseOpenAutomationQuery (search) {
|
||||
return false
|
||||
}
|
||||
|
||||
function parseOpenWorkersQuery (search) {
|
||||
const q = filterDeepLinkQuery('guild-channel', String(search || '').replace(/^\?/, ''))
|
||||
for (const part of q.split('&')) {
|
||||
if (!part) continue
|
||||
const eq = part.indexOf('=')
|
||||
const k = eq >= 0 ? part.slice(0, eq) : part
|
||||
const v = eq >= 0 ? part.slice(eq + 1) : ''
|
||||
if (k === 'workers' || k === 'integration-workers') return !v || v === '1' || v === 'true'
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
function parseEditChannelPermissionsQuery (search) {
|
||||
const q = filterDeepLinkQuery('guild-channel', String(search || '').replace(/^\?/, ''))
|
||||
for (const part of q.split('&')) {
|
||||
|
||||
Reference in New Issue
Block a user