Wire settings-open/close UI-flow IPC and category on deep-link format.
Merges settings-open and settings-close with section-change handling so composer focus and pushState stay consistent. format-settings-deep-link accepts category from the renderer for canonical pearcord://settings URLs. Co-authored-by: Cursor <[email protected]>
This commit is contained in:
@@ -1322,7 +1322,8 @@ async function dispatchUiMessage (platform, msg, hooks = {}) {
|
|||||||
const url = platform.formatSettingsDeepLink({
|
const url = platform.formatSettingsDeepLink({
|
||||||
section: msg.section,
|
section: msg.section,
|
||||||
scope: msg.scope,
|
scope: msg.scope,
|
||||||
guildId: msg.guildId
|
guildId: msg.guildId,
|
||||||
|
category: msg.category
|
||||||
})
|
})
|
||||||
send({
|
send({
|
||||||
type: 'settings-deep-link',
|
type: 'settings-deep-link',
|
||||||
@@ -3151,7 +3152,7 @@ async function dispatchUiMessage (platform, msg, hooks = {}) {
|
|||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
if (t === 'settings-section-change') {
|
if (t === 'settings-open' || t === 'settings-close' || t === 'settings-section-change') {
|
||||||
pushState()
|
pushState()
|
||||||
if (platform.activeChannelId) {
|
if (platform.activeChannelId) {
|
||||||
send({
|
send({
|
||||||
@@ -3159,11 +3160,21 @@ async function dispatchUiMessage (platform, msg, hooks = {}) {
|
|||||||
channelId: platform.activeChannelId
|
channelId: platform.activeChannelId
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
send({
|
if (t === 'settings-section-change') {
|
||||||
type: 'settings-section-changed',
|
send({
|
||||||
section: msg.section || null,
|
type: 'settings-section-changed',
|
||||||
scope: msg.scope || 'user'
|
section: msg.section || null,
|
||||||
})
|
scope: msg.scope || 'user',
|
||||||
|
guildId: msg.guildId || null
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
send({
|
||||||
|
type: t === 'settings-open' ? 'settings-opened' : 'settings-closed',
|
||||||
|
section: msg.section || null,
|
||||||
|
scope: msg.scope || 'user',
|
||||||
|
guildId: msg.guildId || null
|
||||||
|
})
|
||||||
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
if (t === 'composer-ime-composing') {
|
if (t === 'composer-ime-composing') {
|
||||||
|
|||||||
Reference in New Issue
Block a user